Skip to content

Commit

Permalink
add missing tests for node:path/* and node:util/types (#3010)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig authored Oct 28, 2024
1 parent efe5c43 commit ea8a12f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/workerd/api/node/tests/path-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,3 +618,24 @@ export const test_path_basename = {
);
},
};

export const make_sure_posix_win32_works = {
async test() {
{
const pathModule = await import('node:path/win32');
strictEqual(typeof pathModule.default.resolve, 'function');
strictEqual(
typeof process.getBuiltinModule('node:path/win32').resolve,
'function'
);
}
{
const pathModule = await import('node:path/posix');
strictEqual(typeof pathModule.default.resolve, 'function');
strictEqual(
typeof process.getBuiltinModule('node:path/posix').resolve,
'function'
);
}
},
};
2 changes: 1 addition & 1 deletion src/workerd/api/node/tests/path-test.wd-test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const unitTests :Workerd.Config = (
modules = [
(name = "worker", esModule = embed "path-test.js")
],
compatibilityDate = "2023-01-15",
compatibilityDate = "2024-10-11",
compatibilityFlags = ["nodejs_compat"]
)
),
Expand Down
7 changes: 7 additions & 0 deletions src/workerd/api/node/tests/util-nodejs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4368,3 +4368,10 @@ export const isArray = {
assert.ok(!util.isArray('hello world'));
},
};

export const makeSureUtilTypesIsExported = {
async test() {
const types = await import('node:util/types');
assert.ok(types, 'node:util/types is not exported');
},
};

0 comments on commit ea8a12f

Please sign in to comment.