-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Run tests e2e against an npm pack && npm install
ed ts-node
#1032
Conversation
await execP(`npm install`, { cwd: TEST_DIR }) | ||
const packageLockPath = join(TEST_DIR, 'package-lock.json') | ||
existsSync(packageLockPath) && unlinkSync(packageLockPath) | ||
}) |
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 wonder if these a way to do this outside of the test suite or possibly a separate set of tests? Either way this looks like a great start at coverage.
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 can definitely move the npm pack
into our npm build
. That would be better since it would npm pack
using the same node and npm versions as we use to publish
.
Are you thinking you want 2x sets of tests, one unit tests, the other doing these e2e-style tests against an npm install
?
I thought about that but I wasn't sure how useful it'd be since the tests mostly look e2e-style already. Your call though, happy to split things out.
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.
Let's keep it how it is then, I don't have strong opinions either way but it's great to know you thought about this.
@blakeembrey This is ready for (one more) review. I moved the Here are the changes since your last review to make it a little easier. |
This is necessary to test that our entrypoints are working correctly with package.json "exports".
This change runs
npm pack
to create a tarball, thennpm install
s it intotests/node_modules/
The tests
require('ts-node/register')
and exec./node_modules/.bin/ts-node
so it matches how a consumer invokests-node
.