Skip to content

Commit

Permalink
Make test cleanup script a TS script
Browse files Browse the repository at this point in the history
  • Loading branch information
lafkpages committed Oct 14, 2023
1 parent eff20f5 commit 054c82a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
},
"scripts": {
"build": "bun scripts/build.ts",
"build:docs": "typedoc src/index.ts"
"build:docs": "typedoc src/index.ts",
"pretest": "bun scripts/cleanup-test-data.ts",
"test": "bun test"
}
}
13 changes: 13 additions & 0 deletions scripts/cleanup-test-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { rm, readdir } from "fs/promises";
import { join as joinPaths } from "path";

// rm -f test/ignore/*.{js,json,txt}
// rm -f test/ignore/app-*.asar

const ignoreDir = "test/ignore";

for (const file of await readdir(ignoreDir)) {
if (/\.(js|json|txt)$|^app-.+\.asar/.test(file)) {
await rm(joinPaths(ignoreDir, file));
}
}
4 changes: 0 additions & 4 deletions test/cleanupTestData.sh

This file was deleted.

0 comments on commit 054c82a

Please sign in to comment.