-
Notifications
You must be signed in to change notification settings - Fork 327
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
Swap the jest
testing framwork for ava
#18
Conversation
If I checkout this branch and try to run
|
Hmm, they work for me locally, and on actions. What's your nodejs version? I do remember reading something that this requires quite a new version. I'm on |
I'm on |
29ae35b
to
aad62f0
Compare
Hmm, I've just installed Can you try again and post the error again? If it's a failure in |
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.
Now it works for me, I don't know what was the issue but it seems to be resolved
aad62f0
to
572c8bb
Compare
Somehow when rebasing to fix conflicts the churn has gone from +102,885 −1,442,871 down to +86,502 −1,442,275. This is all just random noise in the node_modules directory. All my changes to the package.json file are the same. |
Usage of Jest was removed in #18
The main purpose of this is a side project of mine to reduce the number of dependencies we have. It turns out that jest is absolutely humungous. This PR switches it for a more minimal testing framework called ava with no loss of functionality.
Don't get me wrong, jest is quite nice to use, but we don't use anything like its full feature set, so we can switch to a more minimal framework and still be able to do everything we want. I haven't used ava before but it seems reasonable and it's the most lightweight option I've found so far.
Some numbers:
node_modules
directory currently contains 16710 files. If we removejest
that come sdown to 2180 files. After addingava
in it goes back up to 5394, but still far below the original number.The main change that was necessary to support this is that we need to now compile our test files to javascript before running them, while previousy we could run the typescript "directly" and it would be compiled for us. I think this is fine and it comes with the bonus that our linting rules now apply to our test files, where previously it appears there weren't.
Bonus point, the tests now pass for me locally, while they didn't before and only worked on actions. We used to fail because stuff like
@actions/io
doesn't work when outside of actions. I haven't 100% worked out why this is now working but I have a hunch it's because we are now compiling our test code to javascript.To review, I've tried to keep all
node_moduldes
changes to the first commit, so you can skim through that. All the interesting changes are in the second commit.Merge / deployment checklist