Skip to content

Commit

Permalink
this
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk committed Dec 17, 2024
1 parent 486b8b1 commit 1206b37
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/get_unit_test_dir_list.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { glob } from 'glob';
import * as path from 'path';
import semver from 'semver';

let result = await glob('packages/*');
result = result.filter((result) => !result.includes('integration-tests'));
result.push(
path.join('packages', 'integration-tests', 'lib', 'test-in-memory')
);
result = result.map((path) => `${path}/**/*.test.js`);

const nodeVersion = semver.parse(process.versions.node);
if (nodeVersion && nodeVersion.major >= 22) {
// Starting from version 22. Node test runner's cli changed how search pattern works.
// It would try to load paths as modules if "**/*.test.js" search pattern is omitted.
result = result.map((path) => `${path}/**/*.test.js`);
}

console.log(result.join(' '));

0 comments on commit 1206b37

Please sign in to comment.