Skip to content

Commit

Permalink
ignore tsx for node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jan 13, 2025
1 parent cf41e83 commit 6ba9e77
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const EC = require('eight-colors');
const { spawn } = require('node:child_process');
const Util = require('../lib/utils/util.js');

// eslint-disable-next-line complexity
const executeNpmRun = (item) => {
const nv = process.versions.node;

Expand Down Expand Up @@ -32,6 +33,16 @@ const executeNpmRun = (item) => {

}

if (Util.cmpVersion(nv, '22') > 0) {

// module register added in Node.js: v20.6.0
if (item.includes('tsx')) {
EC.logYellow(`Ignore test tsx - node ${nv} > 22`);
return 0;
}

}

return new Promise((resolve) => {
const worker = spawn(`npm run ${item}`, {
shell: true,
Expand Down

0 comments on commit 6ba9e77

Please sign in to comment.