deno.land / std@0.166.0 / _tools / check_doc_imports_test.ts

check_doc_imports_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
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../testing/asserts.ts";import { isWindows } from "../_util/os.ts";
const ROOT = new URL(import.meta.url);
Deno.test("doc import checker process should exit with code 1 and print warnings", async () => { const command = new Deno.Command(Deno.execPath(), { env: { NO_COLOR: "true", }, args: [ "run", "--allow-env", "--allow-read", new URL("./check_doc_imports.ts", ROOT).toString(), "--test-mode", ], stderr: "null", }); const { code, stdout } = await command.output(); const expected = await Deno.readFile( new URL( `./testdata/import_check_${isWindows ? "win32" : "posix"}.txt`, ROOT, ), );
assertEquals(code, 1); // TODO(kt3k): Temporarily skips the assertion of the warning messages on linux. if (Deno.build.os === "linux") { return; } assertEquals( new TextDecoder().decode(stdout), new TextDecoder().decode(expected), );});
std
Deno standard library
GitHub Repositorydenoland/deno_std
GitHub Stars
2458

Version Info

Tagged at
2 months ago