deno.land / std@0.91.0 / node / _tools / test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { walk } from "../../fs/walk.ts";import { dirname, fromFileUrl, relative } from "../../path/mod.ts";import { assertEquals } from "../../testing/asserts.ts";import { config, testList } from "./common.ts";
/** * This script will run the test files specified in the configuration file * * Each test file will be run independently and wait until completion, if an abnormal * code for the test is reported, the test suite will fail inmediately */
const dir = walk(fromFileUrl(new URL(config.suitesFolder, import.meta.url)), { includeDirs: false, match: testList,});
const testsFolder = dirname(fromFileUrl(import.meta.url));
for await (const file of dir) { Deno.test({ name: relative(testsFolder, file.path), fn: async () => { const process = Deno.run({ cwd: testsFolder, cmd: [ "deno", "run", "-A", "--quiet", "--unstable", "require.ts", file.path, ], });
const { code } = await process.status(); process.close();
assertEquals(code, 0); }, });}
std

Version Info

Tagged at
3 years ago

External Dependencies

No external dependencies 🎉