1// Flags: --expose-internals 2'use strict'; 3require('../common'); 4const assert = require('assert'); 5const { doesPathMatchFilter } = require('internal/test_runner/utils'); 6 7// Paths expected to match 8[ 9 'test.js', 10 'test.cjs', 11 'test.mjs', 12 'test-foo.js', 13 'test-foo.cjs', 14 'test-foo.mjs', 15 'foo.test.js', 16 'foo.test.cjs', 17 'foo.test.mjs', 18 'foo-test.js', 19 'foo-test.cjs', 20 'foo-test.mjs', 21 'foo_test.js', 22 'foo_test.cjs', 23 'foo_test.mjs', 24].forEach((p) => { 25 assert.strictEqual(doesPathMatchFilter(p), true); 26}); 27 28// Paths expected not to match 29[ 30 'test', 31 'test.djs', 32 'test.cs', 33 'test.mj', 34 'foo.js', 35 'test-foo.sj', 36 'test.foo.js', 37 'test_foo.js', 38 'testfoo.js', 39 'foo-test1.mjs', 40].forEach((p) => { 41 assert.strictEqual(doesPathMatchFilter(p), false); 42}); 43