Add helper for running node tests

This commit is contained in:
Jarred Sumner
2024-12-09 17:37:53 -08:00
parent 3dc3527171
commit c0cf0414a0
2 changed files with 11 additions and 2 deletions

View File

@@ -52,6 +52,10 @@ const integrationTimeout = 5 * 60_000;
const { values: options, positionals: filters } = parseArgs({
allowPositionals: true,
options: {
["node-tests"]: {
type: "boolean",
default: false,
},
["exec-path"]: {
type: "string",
default: "bun",
@@ -949,10 +953,14 @@ async function getVendorTests(cwd) {
* @returns {string[]}
*/
function getRelevantTests(cwd) {
const tests = getTests(cwd);
let tests = getTests(cwd);
const availableTests = [];
const filteredTests = [];
if (options["node-tests"]) {
tests = tests.filter(testPath => testPath.includes("js/node/test/parallel/"));
}
const isMatch = (testPath, filter) => {
return testPath.replace(/\\/g, "/").includes(filter);
};