-
Notifications
You must be signed in to change notification settings - Fork 482
Expand file tree
/
Copy pathinput.js
More file actions
26 lines (20 loc) · 781 Bytes
/
input.js
File metadata and controls
26 lines (20 loc) · 781 Bytes
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
// @ts-check
import * as assert from "node:assert";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import { setup } from "#dev/process";
const { execBuildOrThrow, execClean } = setup(import.meta.dirname);
await execBuildOrThrow();
const content = await fs.readFile(
path.join(import.meta.dirname, "src", "demo.js"),
"utf8",
);
assert.equal(content.match(/A00_a1_main/g)?.length, 3);
assert.equal(content.match(/B00_b1_main/g)?.length, 3);
assert.equal(content.match(/A0_main/g)?.length, 2);
assert.equal(content.match(/a0_main/g)?.length, 1);
assert.equal(content.match(/B0_main/g)?.length, 2);
assert.equal(content.match(/b0_main/g)?.length, 1);
const mod = await import("./src/demo.js");
assert.equal(mod.v, 4, "nested");
await execClean();