-
-
Notifications
You must be signed in to change notification settings - Fork 287
Expand file tree
/
Copy pathglobalSetup.js
More file actions
22 lines (17 loc) · 738 Bytes
/
globalSetup.js
File metadata and controls
22 lines (17 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const fs = require("node:fs");
const path = require("node:path");
const removeIllegalCharacterForWindows = require("./test/helpers/removeIllegalCharacterForWindows");
const baseDir = path.resolve(__dirname, "test/fixtures");
const specialFiles = {
"[special$directory]/nested/nestedfile.txt": "",
"[special$directory]/(special-*file).txt": "special",
"[special$directory]/directoryfile.txt": "new",
};
module.exports = () => {
for (const originFile of Object.keys(specialFiles)) {
const file = removeIllegalCharacterForWindows(originFile);
const dir = path.dirname(file);
fs.mkdirSync(path.join(baseDir, dir), { recursive: true });
fs.writeFileSync(path.join(baseDir, file), specialFiles[originFile]);
}
};