Comparing version 0.18.0 to 0.19.0
@@ -199,3 +199,5 @@ import { run } from 'node:test' | ||
} | ||
const expandedFiles = [] | ||
const globs = [] | ||
for (let i = 0; i < files.length; i += 1) { | ||
@@ -206,5 +208,15 @@ if (files[i].includes('*') === false) { | ||
} | ||
const parsed = await glob(files[i].replace(/^['"]/, '').replace(/['"]$/, ''), { ignore, cwd, windowsPathsNoEscape: true }) | ||
const pattern = files[i].replace(/^['"]/, '').replace(/['"]$/, '') | ||
if (pattern[0] === '!') { | ||
ignore.push(pattern.slice(1)) | ||
continue | ||
} | ||
globs.push(pattern) | ||
} | ||
if (globs.length > 0) { | ||
const parsed = await glob(globs, { ignore, cwd, windowsPathsNoEscape: true }) | ||
Array.prototype.push.apply(expandedFiles, parsed) | ||
} | ||
files = expandedFiles | ||
@@ -226,2 +238,3 @@ } else if (config.pattern) { | ||
config.coverage = false | ||
stream = run(config) | ||
@@ -228,0 +241,0 @@ |
{ | ||
"name": "borp", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"type": "module", | ||
@@ -17,3 +17,3 @@ "description": "node:test wrapper with TypeScript support", | ||
"lint": "standard | snazzy", | ||
"unit": "node borp.js --ignore \"fixtures/**/*\" --coverage --coverage-exclude \"fixtures/**/*\" --coverage-exclude \"test*/**/*\"", | ||
"unit": "node borp.js --ignore \"fixtures/**/*\" -C --coverage-exclude \"fixtures/**/*\" --coverage-exclude \"test*/**/*\"", | ||
"test": "npm run clean ; npm run lint && npm run unit" | ||
@@ -30,2 +30,3 @@ }, | ||
"desm": "^1.3.0", | ||
"semver": "^7.6.3", | ||
"snazzy": "^9.0.0", | ||
@@ -32,0 +33,0 @@ "standard": "^17.1.0", |
@@ -30,2 +30,5 @@ # borp | ||
borp --reporter ./lib/some-reporter.mjs | ||
# matching all test.js files except ones in nested node_modules directories | ||
borp 'test/**/*.test.js' '!test/**/node_modules/**/*.test.js' | ||
``` | ||
@@ -141,2 +144,5 @@ | ||
+ `files` (string[]): An array of test files to include. Globs are supported. | ||
Note: any glob that starts with a `!` (bang character) will be treated as | ||
an ignore glob, e.g. `'!test/**/node_modules/**/*'` will ignore all files | ||
in nested `node_modules` directories that would otherwise be matched. | ||
+ `reporters` (string[]): An array of reporters to use. May be relative path | ||
@@ -143,0 +149,0 @@ strings, or module name strings. |
@@ -115,5 +115,22 @@ import { test } from 'node:test' | ||
strictEqual(stdout.indexOf('tests 2') >= 0, true) | ||
strictEqual(stdout.indexOf('✔ add') >= 0, true) | ||
strictEqual(stdout.indexOf('✔ add2') >= 0, true) | ||
strictEqual(stdout.indexOf('✔ a thing'), -1) | ||
}) | ||
test('interprets globs for files with an ignore rule', async () => { | ||
const cwd = join(import.meta.url, '..', 'fixtures', 'files-glob') | ||
const { stdout } = await execa('node', [ | ||
borp, | ||
'\'**/*.test.js\'', | ||
'\'!test1/**/node_modules/**/*\'' | ||
], { | ||
cwd | ||
}) | ||
strictEqual(stdout.indexOf('✔ add') >= 0, true) | ||
strictEqual(stdout.indexOf('✔ add2') >= 0, true) | ||
strictEqual(stdout.indexOf('✔ a thing'), -1) | ||
}) | ||
test('Post compile script should be executed when --post-compile is sent with esm', async () => { | ||
@@ -120,0 +137,0 @@ const cwd = join(import.meta.url, '..', 'fixtures', 'ts-esm-post-compile') |
@@ -25,3 +25,3 @@ import { test } from 'node:test' | ||
borp, | ||
'--coverage', | ||
'-C', | ||
'--coverage-exclude=src' | ||
@@ -28,0 +28,0 @@ ], { |
@@ -8,5 +8,6 @@ import { test } from 'node:test' | ||
import { once } from 'node:events' | ||
import semver from 'semver' | ||
// These tests are currently broken on node v22 | ||
const skip = process.platform === 'darwin' && process.version.startsWith('v22') | ||
// These tests are currently broken on some node versions | ||
const skip = process.platform === 'darwin' && semver.satisfies(process.version, '>=20.16.0 <22.10.0') | ||
@@ -13,0 +14,0 @@ test('watch', { skip }, async (t) => { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59618
1711
165
9