This commit is contained in:
Dmitry Vasilev
2022-12-23 03:34:09 +08:00
parent 5be750b424
commit 8d4803594b
3 changed files with 5 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import * as pathlib from 'path'
import {COMMANDS} from '../src/cmd.js'
import {root_calltree_node} from '../src/calltree.js'
import { assert_equal, test_initial_state, } from './utils.js'
import {tests} from './test.js'
// Should work same as src/filesystem.js:load_dir
const load_dir = path => {
@@ -85,6 +86,6 @@ const run = root.children[0]
assert_equal(root_calltree_node(state).ok, true)
// Assert that run children are tests
assert_equal(run.children.length > 100, true)
assert_equal(run.children.length, tests.length)
console.timeEnd('run')

View File

@@ -154,7 +154,7 @@ export const test_only = (message, t) => test(message, t, true)
export const run = Object.defineProperty(new Function('tests', `
// Runs test, return failure or null if not failed
const run_test = t => {
return Promise.resolve(t.test())
return Promise.resolve().then(t.test)
.then(() => null)
.catch(e => {
if(globalThis.process != null) {