Skip to content

Make tests ES module ready - #36

Merged
dderevjanik merged 3 commits into
dderevjanik:masterfrom
s-weigand:tests-esm-ready
Apr 7, 2021
Merged

Make tests ES module ready#36
dderevjanik merged 3 commits into
dderevjanik:masterfrom
s-weigand:tests-esm-ready

Conversation

@s-weigand

Copy link
Copy Markdown
Contributor

With the tests, as they are right now changing the import style of select-dom to ES module, as proposed in #35, will break the tests again.
The solution is to use the beta versions of ts-jest and jest 27 which add support for es modules.
For the tests to pass, I needed to remove the done callbacks added in #34, since they are considered an error in jest 27.

While being there I also changed the name of the lint command to format and added a lint command (only using prettier) which is run by the CI.
To make the definition of chained commands more concise I added npm-run-all as a dev dependency, so there is no more need to prepend npm run to each command defined in package.json.

- "lint": "npm run lint:packages && npm run lint:json && npm run lint:typings",
+ "lint": "run-s lint:packages lint:json lint:typings",

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.
Comment thread package.json
"format:typings": "prettier --write ./typings/**/*.d.ts",
"test": "jest --coverage"
},
"jest": {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could use config file for jest in near future. What do you think @s-weigand ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, If you want I can move the config in this PR.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's ok, I'm going to merge it now.....

@dderevjanik
dderevjanik merged commit 9451901 into dderevjanik:master Apr 7, 2021
@s-weigand
s-weigand deleted the tests-esm-ready branch April 7, 2021 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants