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
Convert to ESM #1391
base: main
Are you sure you want to change the base?
Convert to ESM #1391
Conversation
The failing test is trying to import the esm module as cjs which should't work. |
The CJS test can be removed since it will no longer be supported. |
98b1244
to
74b5c39
Compare
All good now 😃 |
# turn off stop on error | ||
set +e |
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.
Can you clarify why this is needed?
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.
IIRC this was causing the verdaccio shutdown to fail. Not sure any more :-/
test/e2e.sh
Outdated
|
||
# turn off stop on error | ||
set +e | ||
|
||
exit_status=$? |
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 needs to be the first line in the trap function to capture the exit code correctly. I'm seeing "Done" printed instead of "Error" when I fail the test intentionally.
package.json
Outdated
"lint:src": "eslint --cache --cache-location node_modules/.cache/.eslintcache --ignore-path .gitignore --report-unused-disable-directives .", | ||
"prepare": "src/scripts/install-hooks && test/bun-setup.sh", | ||
"prepublishOnly": "npm run build", | ||
"prettier": "prettier . --check", | ||
"test": "npm run test:unit && npm run test:e2e", | ||
"test:unit": "mocha test test/package-managers/*", | ||
"test:unit": "vitest test/package-managers/*", |
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.
You've accidentally dropped the main test suite in the test
directory. Once enabled, I'm seeing: process.chdir() is not supported in workers
.
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.
how did I drop it? Not sure why that message though.
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.
mocha test test/package-managers/*
specifies two paths: ./test
and ./test/package-managers/*
. This edit removes the ./test
path from the test:unit
script (which is the main test suite for the project).
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.
ah maybe because it always used chdir and vitest uses workers?
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.
process.chdir
is only used in getAllPackages.test.ts
, and it appears to be a remnant of some local testing that another developer did. The tests pass without it, so I removed it in 688c07f.
You can either rebase on main
, or cherry pick that commit if you want to get the tests working before dealing with the merge conflicts.
@wmertens Just checking in to see if you have an update. |
48bba1e
to
16d9f6f
Compare
I'm trying to rebase but
|
Sorry about that! I got the same thing, but I was hoping it would work once the lock file was updated. It installs fine in ci mode. Try |
:( doesn't work, and when I try to install oven, it gets worse:
|
I tried pushing without updating the npm lock but then the markdown lint complains about readme |
Okay. I think since bun is not very cross-platform compatible, I will move it into a separate optional test script, and remove it from devDependencies. |
26c7b5c
to
bc18c92
Compare
Okay, I've offloaded the bun tests to a separate script in bc18c92. You no longer need bun to npm install and run the unit tests. |
uses same build setup as vite; mocha doesn't like ESM
No description provided.