Skip to content

Commit 4a388f1

Browse files
committed
fixup! test: ensure assertions are reached on more tests
1 parent 008eed0 commit 4a388f1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/module-hooks/test-module-hooks-custom-conditions-cjs.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const common = require('../common');
55
const { registerHooks } = require('node:module');
66
const assert = require('node:assert');
77
const { cjs, esm } = require('../fixtures/es-modules/custom-condition/load.cjs');
8-
const { mustCall } = require('../common/index.mjs');
98

109
(async () => {
1110
// Without hooks, the default condition is used.
@@ -16,7 +15,7 @@ const { mustCall } = require('../common/index.mjs');
1615
// allow a CJS to be resolved with that condition.
1716
{
1817
const hooks = registerHooks({
19-
resolve: mustCall((specifier, context, nextResolve) => {
18+
resolve: common.mustCall((specifier, context, nextResolve) => {
2019
assert(Array.isArray(context.conditions));
2120
context.conditions = ['foo', ...context.conditions];
2221
return nextResolve(specifier, context);
@@ -31,7 +30,7 @@ const { mustCall } = require('../common/index.mjs');
3130
// allow a ESM to be resolved with that condition.
3231
{
3332
const hooks = registerHooks({
34-
resolve: mustCall((specifier, context, nextResolve) => {
33+
resolve: common.mustCall((specifier, context, nextResolve) => {
3534
assert(Array.isArray(context.conditions));
3635
context.conditions = ['foo-esm', ...context.conditions];
3736
return nextResolve(specifier, context);
@@ -45,7 +44,7 @@ const { mustCall } = require('../common/index.mjs');
4544
// Duplicating the 'foo' condition in the resolve hook should not change the result.
4645
{
4746
const hooks = registerHooks({
48-
resolve: mustCall((specifier, context, nextResolve) => {
47+
resolve: common.mustCall((specifier, context, nextResolve) => {
4948
assert(Array.isArray(context.conditions));
5049
context.conditions = ['foo', ...context.conditions, 'foo'];
5150
return nextResolve(specifier, context);

0 commit comments

Comments
 (0)