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

test: Use node.js test runner #747

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

test: Use node.js test runner #747

wants to merge 1 commit into from

Conversation

avaly
Copy link
Collaborator

@avaly avaly commented Feb 20, 2024

Warning

This PR is not 100% ready

I was interested to see how far we can get with replacing jest with the new native test runner in Node.js v20.

AFAICT The main blocker now is the fact that we can't mock ESM imports.

import * as model from '../model';
// ...

test('initialize with no models registered', (t) => {
  t.mock.method(model, 'build');

  const papr = new Papr();

  papr.initialize(db); // `model.build` inside the app code will not be mocked

  equal(model.build.mock.callCount(), 0);
});

Any tips on how to proceed would be appreciated.

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

1 participant