Skip to content

Fixes react-codemirror tests #495

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Fixes react-codemirror tests #495

wants to merge 1 commit into from

Conversation

anderson4j
Copy link
Collaborator

@anderson4j anderson4j commented Apr 30, 2025

The problem:
Running e2e tests in the react-codemirror package fails on main with a message like:
SyntaxError: Named export 'testData' not found. The requested module '@neo4j-cypher/language-support' is a CommonJS module, which may not support all module.exports as named exports.
This testData file is part of the language-support package, and we use an ESModule import to access it in the react-codemirror tests.

The fix:
Adding "type": "module" in the package.json of language-support makes it so .js files (the ones we build with the build-esm-and-types script) are treated as ESModule instead of CommonJS.
In the build-commonjs script the output file is already .cjs instead of .js so this should not interfere with the actual CommonJS file.

Although this allows us to run the react-codemirror playwright tests, they often ran out of memory, which is the reason for the change to how much memory nodejs has access to in the e2e scripts.

Even with these changes and the tests running, it seems like the e2e tests are quite flaky locally

Copy link

changeset-bot bot commented Apr 30, 2025

⚠️ No Changeset found

Latest commit: 30f54d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -17,7 +17,7 @@ runs:
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
Copy link
Collaborator Author

@anderson4j anderson4j Apr 30, 2025

Choose a reason for hiding this comment

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

I tried this locally after Oskar's tip, and it does seem to improve flakiness, if not fully fixing it...
Not sure how true this is though, trying to think of a good way to measure it

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.

1 participant