diff --git a/lib/metaltest.test.js b/lib/metaltest.test.js index 527a778..5fcfb81 100644 --- a/lib/metaltest.test.js +++ b/lib/metaltest.test.js @@ -1,7 +1,8 @@ import assert from 'node:assert/strict' -import { metaltest, consolereporter } from '../index.js' +import { metaltest } from '../index.js' const test = metaltest('Metaltest') +export { test } let count = 0 test.before(() => count++) @@ -15,9 +16,7 @@ test('throw', () => { }, { name: 'Error', message: 'message' }) }) -export { test } - -import { runifmain } from './runifmain.js' +import { runifmain, consolereporter } from '../index.js' await runifmain(import.meta, async () => { const stats = await test.run(consolereporter()) assert.equal(count, 4) diff --git a/lib/stackparser.test.js b/lib/stackparser.test.js index 45c3795..e1eb735 100644 --- a/lib/stackparser.test.js +++ b/lib/stackparser.test.js @@ -1,8 +1,9 @@ import assert from 'node:assert/strict' -import { metaltest, consolereporter } from '../index.js' +import { metaltest } from '../index.js' import { stackParser } from './stackparser.js' const test = metaltest('Stack parser') +export { test } test('Diff', () => { try { @@ -16,4 +17,5 @@ test('Diff', () => { } }) -await test.run(consolereporter()) +import { runifmain, consolereporter } from '../index.js' +await runifmain(import.meta, () => test.run(consolereporter())) diff --git a/package.json b/package.json index b7d74e0..b6fa87d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "exports": "./index.js", "scripts": { - "test": "node test.js" + "test": "node suite.js" }, "repository": { "type": "git", diff --git a/suite.js b/suite.js new file mode 100644 index 0000000..357d470 --- /dev/null +++ b/suite.js @@ -0,0 +1,3 @@ +import { suite } from './index.js' + +await suite() \ No newline at end of file