-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add test setup for monorepo and example test #25
Add test setup for monorepo and example test #25
Conversation
426a22f
to
4b0bb0d
Compare
This is something we absolutely need but I'm afraid you're gonna have to do a small re-factor in order to accomodate the new monorepo structure 😬 |
4b0bb0d
to
df85949
Compare
df85949
to
770148f
Compare
@Dhaiwat10 this is now rebased, and makes a couple additional changes to support a monorepo. cc @crondinini to take a look at the monorepo parts (I think i'm understanding what stuff should be shared vs. split, but would be great to ensure this is following your mental model too) |
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.
Love it!
package.json
Outdated
"test": "jest --maxWorkers=2", | ||
"test:watch": "yarn test --watch", | ||
"test:coverage": "jest --coverage --colors --maxWorkers=2" |
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.
We should probably adjust our use of --maxWorkers
flags here. 2
is oddly specific and imo doesn't maximize things in our favor: https://dev.to/vantanev/make-your-jest-tests-up-to-20-faster-by-changing-a-single-setting-i36
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.
yeah, i'll remove the flag. wasn't sure why it was set in the first place, but also we have so few tests anyway, it probably doesn't make a difference
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.
This is great! 🚀
@@ -8,7 +8,15 @@ | |||
"pre-commit-hook": "yarn lint-staged", | |||
"format": "prettier --write", | |||
"build": "yarn workspace @web3-ui/components build", | |||
"test": "yarn workspace @web3-ui/components test" | |||
"test": "jest", |
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.
Yep, absolutely, that is what I was thinking about.
], | ||
coveragePathIgnorePatterns: [ | ||
"/node_modules/", | ||
"dist/", |
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.
Would we need to ignore dist also from within the packages?
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.
i believe this will ignore any instance of dist
, although i might be wrong. we're not using the coverage stats yet though, so it probably doesn't matter?
coveragePathIgnorePatterns: [ | ||
"/node_modules/", | ||
"dist/", | ||
"<rootDir>/packages/components/src/index.ts", |
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.
Why is this needed if it doesn't match the spec?
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.
this is for code coverage metrics. not sure why this file was specifically excluded before, but i kept it here to not break anything historical
I noticed we had no tests, so
yarn test
was failing (locally at least, in CI it was set to pass with no tests). This PR:components
and into the root of the monorepo (so it can be shared by all packages)to: @Dhaiwat10 @crondinini