Skip to content

Commit cd4b569

Browse files
committed
fix(test): fixed npm parity test
1 parent 5d1f97a commit cd4b569

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,13 @@ suite('create-package-json', () => {
286286
assert.deepStrictEqual(pkg.scripts, npmInitPkg.scripts);
287287
assert.deepStrictEqual(pkg.keywords, npmInitPkg.keywords);
288288
assert.strictEqual(pkg.license, npmInitPkg.license);
289-
assert.strictEqual(pkg.type, npmInitPkg.type);
289+
290+
// Handle different behavior for node versions
291+
if (parseInt(process.version.split(/v|\./)[1], 10) < 24) {
292+
assert.notStrictEqual(pkg.type, npmInitPkg.type);
293+
} else {
294+
assert.strictEqual(pkg.type, npmInitPkg.type);
295+
}
290296

291297
// Should be different
292298
assert.notStrictEqual(pkg.author, npmInitPkg.author, JSON.stringify([pkg.author, npmInitPkg.author]));

0 commit comments

Comments
 (0)