Skip to content

Commit

Permalink
yield
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Aug 30, 2024
1 parent 096c895 commit 63c5a09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class TestRunner {
console.log(`${ansi.format(test.metadata.file || '', ['magenta'])} ${test.name}`)
try {
await test.run()
yield test
} catch (err) {
console.log(`${ansi.format(test.metadata.file || '', ['magenta'])} ${test.name} - ${ansi.format('Failed', ['red'])}`)
/* Crash the process */
Expand All @@ -55,6 +56,7 @@ class TestRunner {
}
}

/* not used by start() */
async runAll () {
const result = []
for await (const test of this.run()) {
Expand Down Expand Up @@ -91,6 +93,7 @@ class TestRunner {
}

this.tests = only.length ? only : tests

for await (const test of this.run()) {
if (test.data) {
console.log(indent(os.EOL + util.inspect(test.data, { colors: true }) + os.EOL, ' '))
Expand Down

0 comments on commit 63c5a09

Please sign in to comment.