Skip to content

Commit ac8d5f7

Browse files
committed
Merge branch 'main' of github.com:caoxiemeihao/create-electron-vite into v0.4.0
2 parents cd51d75 + e4b1099 commit ac8d5f7

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

__tests__/cli.spec.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,25 @@ test('prompts for the project name if none supplied', () => {
3333
expect(stdout).toContain('Project name:')
3434
})
3535

36-
test('prompts for project template if none supplied when target dir is current directory', () => {
36+
test('prompts for the framework if none supplied when target dir is current directory', () => {
3737
fs.mkdirSync(generatePath, { recursive: true })
3838
const { stdout } = run(['.'], { cwd: generatePath })
3939
expect(stdout).toContain('Project template:')
4040
})
41+
42+
test('prompts for the framework if none supplied', () => {
43+
const { stdout } = run([projectName])
44+
expect(stdout).toContain('Project template:')
45+
})
46+
47+
test('asks to overwrite non-empty target directory', () => {
48+
createNonEmptyDir()
49+
const { stdout } = run([projectName], { cwd: __dirname })
50+
expect(stdout).toContain(`Target directory "${projectName}" is not empty.`)
51+
})
52+
53+
test('asks to overwrite non-empty current directory', () => {
54+
createNonEmptyDir()
55+
const { stdout } = run(['.'], { cwd: generatePath })
56+
expect(stdout).toContain(`Current directory is not empty.`)
57+
})

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"starter"
3232
],
3333
"scripts": {
34+
"preinstall": "npx only-allow pnpm",
3435
"watch": "vite build --watch",
3536
"build": "vite build",
3637
"prepublishOnly": "npm run build && npm run test",
@@ -50,5 +51,6 @@
5051
},
5152
"engines": {
5253
"node": "^14.18.0 || >=16.0.0"
53-
}
54+
},
55+
"packageManager": "[email protected]"
5456
}

0 commit comments

Comments
 (0)