Skip to content

Commit

Permalink
Remove outdated workaround, fixed since Nodejs 20.6.0 (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick authored Oct 4, 2023
1 parent aeb5dff commit 6e8d6a7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions scripts/run_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ import { readdirSync } from 'node:fs';
import { join } from 'path';
import { execFileSync } from 'node:child_process';

// TODO: Update with enabling withFileTypes if fixed the feature
//
// Do NOT specify both recursive and withFileTypes as true, entries will be missed in v20.5.1
// - https://github.com/kachick/times_kachick/issues/244
// - https://github.com/nodejs/node/pull/48698
const baseNames = readdirSync('src', { encoding: 'utf-8', recursive: true, withFileTypes: false });

const testPaths = baseNames.flatMap((name) => name.endsWith('.test.ts') ? [join('src', name)] : []);
const dirEnts = readdirSync('.', { encoding: 'utf-8', recursive: true, withFileTypes: true });
const testPaths = dirEnts.flatMap((dirent) => dirent.name.endsWith('.test.ts') ? [join(dirent.path, dirent.name)] : []);

console.log('Starting to run tests for', testPaths);

Expand Down

0 comments on commit 6e8d6a7

Please sign in to comment.