-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
MODULE_GLOB.test.mjs
54 lines (49 loc) · 1.06 KB
/
MODULE_GLOB.test.mjs
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
45
46
47
48
49
50
51
52
53
54
// @ts-check
import { deepEqual } from "node:assert";
import { globby } from "globby";
import MODULE_GLOB from "./MODULE_GLOB.mjs";
/**
* Adds `MODULE_GLOB` tests.
* @param {import("test-director").default} tests Test director.
*/
export default (tests) => {
tests.add("`MODULE_GLOB` with matching modules.", async () => {
deepEqual(
await globby(MODULE_GLOB, {
cwd: new URL(
"./test/fixtures/MODULE_GLOB/matching-modules/",
import.meta.url
),
}),
[
".cjs",
".cts",
".js",
".mjs",
".mts",
"a.mjs",
"ad.cts",
"ad.mts",
"a/.cjs",
"a/.cts",
"a/.js",
"a/.mjs",
"a/.mts",
"a/a.mjs",
"a/ad.cts",
"a/ad.mts",
]
);
});
tests.add("`MODULE_GLOB` with excluded files.", async () => {
deepEqual(
await globby(MODULE_GLOB, {
cwd: new URL(
"./test/fixtures/MODULE_GLOB/excluded-files/",
import.meta.url
),
}),
[]
);
});
};