Make tests ES module ready - #36
Merged
Merged
Conversation
This way PR#35 won't break the tests. Also removed the unneeded done callback from tests since the cause an error in jest 27.
- Added `npm run lint` step to the CI - Added 'npm-run-all' as a dev dependency to make running npm tasks more concise.
dderevjanik
reviewed
Apr 7, 2021
| "format:typings": "prettier --write ./typings/**/*.d.ts", | ||
| "test": "jest --coverage" | ||
| }, | ||
| "jest": { |
Owner
There was a problem hiding this comment.
Maybe we could use config file for jest in near future. What do you think @s-weigand ?
Contributor
Author
There was a problem hiding this comment.
Sure, If you want I can move the config in this PR.
Owner
There was a problem hiding this comment.
That's ok, I'm going to merge it now.....
This file contains hidden or 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
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.
With the tests, as they are right now changing the import style of
select-domto ES module, as proposed in #35, will break the tests again.The solution is to use the beta versions of
ts-jestandjest27 which add support for es modules.For the tests to pass, I needed to remove the
donecallbacks added in #34, since they are considered an error injest27.While being there I also changed the name of the
lintcommand to format and added alintcommand (only usingprettier) which is run by the CI.To make the definition of chained commands more concise I added
npm-run-allas a dev dependency, so there is no more need to prependnpm runto each command defined inpackage.json.