Add test suite
parent
6927f40096
commit
a46c2d73c8
|
@ -1,7 +1,8 @@
|
||||||
import assert from 'node:assert/strict'
|
import assert from 'node:assert/strict'
|
||||||
import { metaltest, consolereporter } from '../index.js'
|
import { metaltest } from '../index.js'
|
||||||
|
|
||||||
const test = metaltest('Metaltest')
|
const test = metaltest('Metaltest')
|
||||||
|
export { test }
|
||||||
|
|
||||||
let count = 0
|
let count = 0
|
||||||
test.before(() => count++)
|
test.before(() => count++)
|
||||||
|
@ -15,9 +16,7 @@ test('throw', () => {
|
||||||
}, { name: 'Error', message: 'message' })
|
}, { name: 'Error', message: 'message' })
|
||||||
})
|
})
|
||||||
|
|
||||||
export { test }
|
import { runifmain, consolereporter } from '../index.js'
|
||||||
|
|
||||||
import { runifmain } from './runifmain.js'
|
|
||||||
await runifmain(import.meta, async () => {
|
await runifmain(import.meta, async () => {
|
||||||
const stats = await test.run(consolereporter())
|
const stats = await test.run(consolereporter())
|
||||||
assert.equal(count, 4)
|
assert.equal(count, 4)
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import assert from 'node:assert/strict'
|
import assert from 'node:assert/strict'
|
||||||
import { metaltest, consolereporter } from '../index.js'
|
import { metaltest } from '../index.js'
|
||||||
import { stackParser } from './stackparser.js'
|
import { stackParser } from './stackparser.js'
|
||||||
|
|
||||||
const test = metaltest('Stack parser')
|
const test = metaltest('Stack parser')
|
||||||
|
export { test }
|
||||||
|
|
||||||
test('Diff', () => {
|
test('Diff', () => {
|
||||||
try {
|
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",
|
"type": "module",
|
||||||
"exports": "./index.js",
|
"exports": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node test.js"
|
"test": "node suite.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in New Issue