Skip to content

Commit 0d0e5db

Browse files
committed
fix(create-email): Tests
1 parent 9832b5e commit 0d0e5db

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/create-email/src/index.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { spawnSync } from 'node:child_process';
2-
import { promises as fs } from 'node:fs';
2+
import { existsSync, promises as fs } from 'node:fs';
33
import path from 'node:path';
44

55
describe('automatic setup', () => {
66
const starterPath = path.resolve(__dirname, '../.test');
77
test.sequential('creation', async () => {
8-
await fs.rm(starterPath, { recursive: true });
8+
if (existsSync(starterPath)) {
9+
await fs.rm(starterPath, { recursive: true });
10+
}
911

1012
const createEmailProcess = spawnSync(
1113
'node',

packages/create-email/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"include": ["**/*.ts", "**/*.tsx"],
44
"exclude": ["dist", "build", "node_modules", ".test"],
55
"compilerOptions": {
6-
"noEmit": true
6+
"noEmit": true,
7+
"types": ["vitest/globals"]
78
}
89
}

packages/create-email/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export default defineConfig({
44
test: {
55
globals: true,
66
environment: 'happy-dom',
7-
exclude: ['.test/**/*', '**/node_modules'],
7+
exclude: ['.test/**/*', 'template/**/*', '**/node_modules'],
88
},
99
});

0 commit comments

Comments
 (0)