-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(major): reimplement, smaller & faster #15
Open
tunnckoCore
wants to merge
13
commits into
master
Choose a base branch
from
next
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
=========================================
+ Coverage 87.8% 100% +12.19%
=========================================
Files 2 4 +2
Lines 164 122 -42
=========================================
- Hits 144 122 -22
+ Misses 20 0 -20
Continue to review full report at Codecov.
|
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
TODO: reporters are not accessible. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't know why, but from time to time, I sit and write test / task runners. 🤣
Always trying different ways, different approach, smallest possible implementation and so on. This time, I just realized that 60 lines of code are enough and pretty useful and stable and extensible. As always, code comments for docs are 3-4 times more than the actual code.
I'm back to the idea that we don't need CLI. And it makes sense to be a separate thing. What's the most common case? You write a small library with one test file, in most of the time. You literally don't need transpiling, workers, tons of useless dependencies.
If you need to be fancy and use ES Modules everywhere and your target Node.js version is at least v8.10+, then you can just use the
esm
loader passed to thenode
executable. In case you want Babel or TypeScript, you still and currently can do it: just pass the require hook tonode
binary when running the tests, and to therequire
hook ofnyc
(not to thenode
binary) when running test coverage.But it should be simple, small, fast and enough. Basic & TAP Spec coompliant repoter and let users choose whatever they want.
This time the main purpose was to totally minimize the usage of node built-in modules and whatnot, so to be compatible with the browser. And yes, it works there.
In bonus, just for the fun and profit, I decided to bundle it, so installation times are zero seconds. It was around 18kb as a whole and 6kb minified.
The good and the bad thing is that it not include assertion api - you can choose whatever you want, it works well with both the builtin
assert
and Jest'sexpect
. There are Pros and Cons about that, but for now we will go that way, at least until I create the small and awesomeazy
assertion library that will work well with every testing framework.In future there will be a CLI, of course. But it will be just for more advanced users and more bigger projects.