8000 chore: a bit more test/config cleanup · tgriesser/autobarrel@e17578f · GitHub
[go: up one dir, main page]

Skip to content

Commit e17578f

Browse files
committed
chore: a bit more test/config cleanup
1 parent 57f8a75 commit e17578f

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"autobarrel": "dist/cli.js"
99
},
1010
"scripts": {
11+
"clean": "rm -rf dist",
12+
"build": "tsc",
1113
"postinstall": "typesync",
12-
"prepublish": "rm -rf dist && tsc && chmod +x dist/cli.js",
14+
"prepublish": "yarn clean && yarn build && chmod +x dist/cli.js",
1315
"watch": "tsc --watch",
1416
"test": "node ./node_modules/.bin/jest --runInBand"
1517
},

test/__snapshots__/cli.spec.ts.snap

+19
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ Array [
4747
]
4848
`;
4949

50+
exports[`watch mode dir remove should run --watch mode, watch dir remove: After dir remove 1`] = `
51+
"// created by autobarrel, do not modify directly
52+
53+
export * from './watch'"
54+
`;
55+
56+
exports[`watch mode dir remove should run --watch mode, watch dir remove: Before dir remove 1`] = `
57+
"// created by autobarrel, do not modify directly
58+
59+
export * from './addedDir/'
60+
export * from './watch'"
61+
`;
62+
5063
exports[`watch mode should run --watch mode, watch file add: After file add 1`] = `
5164
"// created by autobarrel, do not modify directly
5265
@@ -59,3 +72,9 @@ exports[`watch mode should run --watch mode, watch file add: Before file add 1`]
5972
6073
export * from './watch'"
6174
`;
75+
76+
exports[`watch mode should run --watch mode, watch file remove: Before file remove 1`] = `
77+
"// created by autobarrel, do not modify directly
78+
79+
export * from './watch'"
80+
`;

test/cli.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe("watch mode", () => {
7878
return new Promise((resolve) => setTimeout(resolve, ms))
7979
}
8080

81-
test.only("should run --watch mode, watch file add", async () => {
81+
test("should run --watch mode, watch file add", async () => {
8282
expect(await readWatchIndex()).toMatchSnapshot("Before file add")
8383
await fs.writeFile(
8484
path.join(__dirname, "testing/testDir/watchTest/added.ts"),

test/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4+
"rootDir": ".",
45
"noEmit": true
56
},
67
"exclude": []

0 commit comments

Comments
 (0)
0