MCPcopy Create free account
hub / github.com/dethcrypto/dethcode / run

Function run

packages/ethereum-viewer/src/test/run-tests.ts:4–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2require("mocha/mocha");
3
4export function run(): Promise<void> {
5 return new Promise((resolve, reject) => {
6 mocha.setup({
7 ui: "bdd",
8 reporter: undefined,
9 color: true,
10 });
11
12 // bundles all files in the current directory matching `*.test`
13 const importAll = (r: __WebpackModuleApi.RequireContext) =>
14 r.keys().forEach(r);
15
16 importAll(require.context("..", true, /\.test$/));
17
18 try {
19 // Run the mocha test
20 // You can find the output in Debug Console tab.
21 mocha.run((failures) => {
22 if (failures > 0) {
23 reject(new Error(`${failures} tests failed.`));
24 } else {
25 resolve();
26 }
27 });
28 } catch (err) {
29 console.error(err);
30 reject(err);
31 }
32 });
33}

Callers

nothing calls this directly

Calls 2

importAllFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected