Skip to content
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

fix: use import instead of require when loading runner #148

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Sep 14, 2022

Shouldn't make much of a difference, but in theory it means runPath can point to an ESM module

@SimenB SimenB merged commit f1108ea into main Sep 14, 2022
@SimenB SimenB deleted the use-import-over-require branch September 14, 2022 09:33
tests: Array<Test>,
watcher: TestWatcher,
onStart: OnTestStart,
onResult: OnTestSuccess,
onFailure: OnTestFailure,
options: TestRunnerOptions,
): Promise<void> {
const runner = (await import(runPath)).default;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm.. I still see require in the lates version. Is this because of Babel:

const runner = (await Promise.resolve(`${runPath}`).then(s => _interopRequireWildcard(require(s)))).default;

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch 👍

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.

None yet

2 participants