-
Notifications
You must be signed in to change notification settings - Fork 43
fix: make the generated test runner compatible with ESM output #477
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
base: main
Are you sure you want to change the base?
Conversation
Fixes ESM compatibility of the transformed output by changing the generated test_runner.js to a .cjs extension.
|
CI / test pipeline is failing due to a linter issue. The issue's specifically with Since inline imports are allowed in Deno/JS and they're used across the whole project, I assume this is in line with Let me know if that's okay or if you'd prefer replacing the inline imports with deps declared in deno.jsonc 🙏 |
| // Copyright 2018-2024 the Deno authors. MIT license. | ||
|
|
||
| import { parse } from "jsr:@std/csv/parse"; | ||
| import { parse } from "jsr:@std/csv@1.0.6/parse"; |
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.
Linter was complaining about unspecified version. I used the latest @std/csv version specified in deno.lock.
| "no-explicit-any", | ||
| "camelcase" | ||
| "camelcase", | ||
| "no-import-prefix" |
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 got added to the default ruleset in Deno 2.5. My assumption is this project's okay with inline imports, so I've excluded the rule here.
Summary:
Fixes ESM compatibility of the transformed output test runner by changing the generated test_runner.js to a .cjs extension.
Details:
Changing the extension to .cjs makes Node always treat the test runner file as a CJS module no matter the module type of the output package.json (
"type": "module","type": "commonjs"or no"type"specified).This change should be fully backwards-compatible and non-breaking.
Fixes #476
Checks:
deno task test) passing with Node versions 18-24