-
-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(jest): create jest config package for unit testing #3678
Conversation
need to add the workflow |
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
7783ea2
to
f043035
Compare
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks so much for making this work! I think the only uncertainty I have is whether it would be better to put test code next to the source code, either in the same folder or in a __tests__
subdir. That way, it's easier to keep track of source code having corresponding tests, although coverage should help with that too.
@@ -72,33 +72,11 @@ module.exports = function (options = {}) { | |||
{ | |||
// Matches .js, .jsx, .ts, .tsx | |||
// See: https://regexr.com/5snjd | |||
test: /\.(j|t)sx?$/, | |||
test: /\.[jt]sx?$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot cleaner, yay!
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
I don't have any strong opinions about this at the moment. I'm okay with it either way. We will probably find out as we write more tests in the future. |
Let's keep as is for now then, LGTM! |
# Conflicts: # yarn.lock
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Changes proposed in this pull request:
This is part one of two PRs to introduce tests to our JavaScript codebase. This PR lays the foundation by introducing a
flarum-jest-config
package and the necessary changes to begin unit testing. An example coreabbreviateNumber
util test is added as well.Reviewers should focus on:
Part two is here: #3679
Necessity
Confirmed
composer test
).Required changes: