Skip to content

Commit

Permalink
feat: generate start and test NPM scripts (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
szgabsz91 committed Nov 26, 2023
1 parent 8b6c2cd commit 8db43ce
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 15 deletions.
18 changes: 9 additions & 9 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,24 +348,24 @@ async function init() {
if (needsPinia) {
render('config/pinia')
}
if (needsVitest) {
render('config/vitest')
}
if (needsCypress) {
render('config/cypress')
}
if (needsCypressCT) {
render('config/cypress-ct')
}
if (needsNightwatch) {
render('config/nightwatch')
}
if (needsNightwatchCT) {
render('config/nightwatch-ct')
}
if (needsPlaywright) {
render('config/playwright')
}
if (needsVitest) {
render('config/vitest')
}
if (needsCypressCT) {
render('config/cypress-ct')
}
if (needsNightwatchCT) {
render('config/nightwatch-ct')
}
if (needsTypeScript) {
render('config/typescript')

Expand Down
1 change: 1 addition & 0 deletions template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"scripts": {
"dev": "vite",
"start": "npm run dev",
"build": "vite build",
"preview": "vite preview"
},
Expand Down
3 changes: 2 additions & 1 deletion template/config/cypress-ct/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"scripts": {
"test:unit": "cypress run --component",
"test:unit:dev": "cypress open --component"
"test:unit:dev": "cypress open --component",
"test": "npm run test:unit"
},
"dependencies": {
"vue": "^3.3.8"
Expand Down
3 changes: 2 additions & 1 deletion template/config/cypress/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"scripts": {
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'"
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
"test": "npm run test:e2e"
},
"devDependencies": {
"cypress": "^13.5.1",
Expand Down
3 changes: 2 additions & 1 deletion template/config/nightwatch-ct/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"scripts": {
"test:unit": "nightwatch src/components/**/__tests__/*"
"test:unit": "nightwatch src/components/**/__tests__/*",
"test": "npm run test:unit"
},
"dependencies": {
"vue": "^3.3.8"
Expand Down
3 changes: 2 additions & 1 deletion template/config/nightwatch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"scripts": {
"test:e2e": "nightwatch tests/e2e"
"test:e2e": "nightwatch tests/e2e",
"test": "npm run test:e2e"
},
"devDependencies": {
"nightwatch": "^3.3.2",
Expand Down
3 changes: 2 additions & 1 deletion template/config/playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"scripts": {
"test:e2e": "playwright test"
"test:e2e": "playwright test",
"test": "npm run test:e2e"
},
"devDependencies": {
"@playwright/test": "^1.40.0"
Expand Down
3 changes: 2 additions & 1 deletion template/config/vitest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"scripts": {
"test:unit": "vitest"
"test:unit": "vitest",
"test": "npm run test:unit"
},
"dependencies": {
"vue": "^3.3.8"
Expand Down

0 comments on commit 8db43ce

Please sign in to comment.