Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated workaround, fixed since Nodejs 20.6.0 #602

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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