Comparing version 2.0.2 to 2.0.3
@@ -62,3 +62,7 @@ import { types } from 'util'; | ||
for (const file of files) { | ||
await import(pathToFileURL(file)); | ||
try { | ||
await import(pathToFileURL(file)); | ||
} catch (error) { | ||
tests.push([file, () => Promise.reject(error)]); | ||
} | ||
} | ||
@@ -65,0 +69,0 @@ |
{ | ||
"name": "bron", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Tiny test runner", | ||
@@ -42,9 +42,9 @@ "exports": "./index.js", | ||
"devDependencies": { | ||
"eslint": "^7.31.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.23.4", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"prettier": "^2.3.2", | ||
"release-it": "^14.10.1", | ||
"sinon": "^11.1.1" | ||
"eslint-plugin-import": "^2.24.2", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"prettier": "^2.4.1", | ||
"release-it": "^14.11.5", | ||
"sinon": "^11.1.2" | ||
}, | ||
@@ -51,0 +51,0 @@ "release-it": { |
@@ -81,2 +81,23 @@ import { EOL } from 'os'; | ||
{ | ||
const { total, failed, passed } = await run({ files: ['test/ext-error.js'] }); | ||
const output = logStub.args.map(args => args[0]); | ||
const errorArgs = errorStub.args.map(args => args[0]); | ||
assert.deepEqual(output, ['✖ test/ext-error.js']); | ||
assert(errorArgs[0] instanceof Error); | ||
assert.equal(errorArgs[0].message, 'foo is not defined'); | ||
assert.deepEqual(total, 1); | ||
assert.deepEqual(failed, 1); | ||
assert.deepEqual(passed, 0); | ||
console.info(output.join(EOL)); | ||
} | ||
logStub.reset(); | ||
errorStub.reset(); | ||
{ | ||
const { total, failed, passed } = await run({ files: ['test/skip.js'] }); | ||
@@ -83,0 +104,0 @@ const output = logStub.args.map(args => args[0]); |
16914
17
296