Skip to content

Commit 8db43ce

Browse files
committed
feat: generate start and test NPM scripts (#303)
1 parent 8b6c2cd commit 8db43ce

File tree

8 files changed

+22
-15
lines changed

8 files changed

+22
-15
lines changed

index.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -348,24 +348,24 @@ async function init() {
348348
if (needsPinia) {
349349
render('config/pinia')
350350
}
351-
if (needsVitest) {
352-
render('config/vitest')
353-
}
354351
if (needsCypress) {
355352
render('config/cypress')
356353
}
357-
if (needsCypressCT) {
358-
render('config/cypress-ct')
359-
}
360354
if (needsNightwatch) {
361355
render('config/nightwatch')
362356
}
363-
if (needsNightwatchCT) {
364-
render('config/nightwatch-ct')
365-
}
366357
if (needsPlaywright) {
367358
render('config/playwright')
368359
}
360+
if (needsVitest) {
361+
render('config/vitest')
362+
}
363+
if (needsCypressCT) {
364+
render('config/cypress-ct')
365+
}
366+
if (needsNightwatchCT) {
367+
render('config/nightwatch-ct')
368+
}
369369
if (needsTypeScript) {
370370
render('config/typescript')
371371

template/base/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"private": true,
33
"scripts": {
44
"dev": "vite",
5+
"start": "npm run dev",
56
"build": "vite build",
67
"preview": "vite preview"
78
},

template/config/cypress-ct/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"scripts": {
33
"test:unit": "cypress run --component",
4-
"test:unit:dev": "cypress open --component"
4+
"test:unit:dev": "cypress open --component",
5+
"test": "npm run test:unit"
56
},
67
"dependencies": {
78
"vue": "^3.3.8"

template/config/cypress/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"scripts": {
33
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
4-
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'"
4+
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
5+
"test": "npm run test:e2e"
56
},
67
"devDependencies": {
78
"cypress": "^13.5.1",

template/config/nightwatch-ct/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"scripts": {
3-
"test:unit": "nightwatch src/components/**/__tests__/*"
3+
"test:unit": "nightwatch src/components/**/__tests__/*",
4+
"test": "npm run test:unit"
45
},
56
"dependencies": {
67
"vue": "^3.3.8"

template/config/nightwatch/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"scripts": {
3-
"test:e2e": "nightwatch tests/e2e"
3+
"test:e2e": "nightwatch tests/e2e",
4+
"test": "npm run test:e2e"
45
},
56
"devDependencies": {
67
"nightwatch": "^3.3.2",

template/config/playwright/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"scripts": {
3-
"test:e2e": "playwright test"
3+
"test:e2e": "playwright test",
4+
"test": "npm run test:e2e"
45
},
56
"devDependencies": {
67
"@playwright/test": "^1.40.0"

template/config/vitest/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"scripts": {
3-
"test:unit": "vitest"
3+
"test:unit": "vitest",
4+
"test": "npm run test:unit"
45
},
56
"dependencies": {
67
"vue": "^3.3.8"

0 commit comments

Comments
 (0)