Add test suite
parent
6927f40096
commit
a46c2d73c8
|
@ -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)
|
||||
|
|
|
@ -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()))
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
"test": "node suite.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in New Issue