Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(run): import core
uvu
within handler;
- ensures `uvu` initializes with shared ENV/global context
- Loading branch information
Showing
2 changed files
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
const { exec } = require('uvu'); | ||
|
||
exports.run = async function (suites, opts={}) { | ||
globalThis.UVU_DEFER = 1; | ||
const uvu = require('uvu'); | ||
|
||
suites.forEach((suite, idx) => { | ||
globalThis.UVU_QUEUE.push([suite.name]); | ||
globalThis.UVU_INDEX = idx; | ||
require(suite.file); | ||
}); | ||
|
||
await exec(opts.bail); | ||
await uvu.exec(opts.bail); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { exec } from 'uvu'; | ||
|
||
export async function run(suites, opts={}) { | ||
let suite, idx=0; | ||
globalThis.UVU_DEFER = 1; | ||
const uvu = await import('uvu'); | ||
|
||
let suite, idx=0; | ||
for (suite of suites) { | ||
globalThis.UVU_INDEX = idx++; | ||
globalThis.UVU_QUEUE.push([suite.name]); | ||
await import('file:///' + suite.file); | ||
} | ||
|
||
await exec(opts.bail); | ||
await uvu.exec(opts.bail); | ||
} |