Ignore test file with no metaltest exported
parent
42fb4ab2c0
commit
036f7a0563
11
suite.js
11
suite.js
|
@ -30,6 +30,7 @@ import { consolereporter, totalreporter } from 'metaltest'
|
||||||
const suite = async (folder = '.') => {
|
const suite = async (folder = '.') => {
|
||||||
const absolutePaths = getStackAbsolutePaths()
|
const absolutePaths = getStackAbsolutePaths()
|
||||||
const absolutePath = absolutePaths[2]
|
const absolutePath = absolutePaths[2]
|
||||||
|
const fileIgnored = []
|
||||||
|
|
||||||
const total = totalreporter()
|
const total = totalreporter()
|
||||||
|
|
||||||
|
@ -40,9 +41,19 @@ const suite = async (folder = '.') => {
|
||||||
|
|
||||||
const module = join(absolutePath, file)
|
const module = join(absolutePath, file)
|
||||||
const { test } = await import(module)
|
const { test } = await import(module)
|
||||||
|
|
||||||
|
if (test === undefined) {
|
||||||
|
fileIgnored.push(file)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
await test.run(consolereporter(), total)
|
await test.run(consolereporter(), total)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const file of fileIgnored) {
|
||||||
|
console.log(`The file ${file} doesn't export the metaltest object`)
|
||||||
|
}
|
||||||
|
|
||||||
console.log(total.msg())
|
console.log(total.msg())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue