Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add Nightwatch for end-to-end testing #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
haoqunjiang merged 17 commits into vuejs:main from vaibhavsingh97:feat/add-nightwatch
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a11b13f
feat: add Nightwatch for end-to-end testing
Apr 19, 2023
c88cc29
feat: add Nightwatch for component testing
Apr 23, 2023
567a902
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
Apr 23, 2023
9c5e4d0
refactor: update tsconfig.json, and generatereadme
Apr 23, 2023
cf50a03
refactor: nightwatch configuration
Apr 24, 2023
e68b381
chore: update tsconfig
Apr 24, 2023
e953f30
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
Apr 24, 2023
faff3f5
update: dependencies and tsconfig
Apr 25, 2023
ceee3c1
feat: add nightwatch in extension recommendation
Apr 25, 2023
25ffcc6
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
May 1, 2023
9299561
chore: update tsconfig
May 4, 2023
4b5a6f8
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
May 4, 2023
5caa581
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
May 4, 2023
86421b0
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
May 4, 2023
204c57c
chore: update tsconfig
May 4, 2023
c106170
Merge remote-tracking branch 'origin/main' into feat/add-nightwatch
May 13, 2023
d4f923a
revert unnecessary change
May 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions index.ts
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { postOrderDirectoryTraverse, preOrderDirectoryTraverse } from './utils/d
import generateReadme from './utils/generateReadme'
import getCommand from './utils/getCommand'
import renderEslint from './utils/renderEslint'
import { FILES_TO_FILTER } from './utils/filterList'

function isValidPackageName(projectName) {
return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName)
Expand Down Expand Up @@ -75,6 +76,7 @@ async function init() {
// --with-tests / --tests (equals to `--vitest --cypress`)
// --vitest
// --cypress
// --nightwatch
// --playwright
// --eslint
// --eslint-with-prettier (only support prettier through eslint for simplicity)
Expand All @@ -101,6 +103,7 @@ async function init() {
argv.tests ??
argv.vitest ??
argv.cypress ??
argv.nightwatch ??
argv.playwright ??
argv.eslint
) === 'boolean'
Expand All @@ -119,7 +122,7 @@ async function init() {
needsRouter?: boolean
needsPinia?: boolean
needsVitest?: boolean
needsE2eTesting?: false | 'cypress' | 'playwright'
needsE2eTesting?: false | 'cypress' | 'nightwatch' | 'playwright'
needsEslint?: boolean
needsPrettier?: boolean
} = {}
Expand All @@ -134,6 +137,7 @@ async function init() {
// - Install Vue Router for SPA development?
// - Install Pinia for state management?
// - Add Cypress for testing?
// - Add Nightwatch for testing?
// - Add Playwright for end-to-end testing?
// - Add ESLint for code quality?
// - Add Prettier for code formatting?
Expand Down Expand Up @@ -226,6 +230,13 @@ async function init() {
: 'also supports unit testing with Cypress Component Testing',
value: 'cypress'
},
{
title: 'Nightwatch',
description: answers.needsVitest
? undefined
: 'also supports unit testing with Nightwatch Component Testing',
value: 'nightwatch'
},
{
title: 'Playwright',
value: 'playwright'
Expand Down Expand Up @@ -283,6 +294,8 @@ async function init() {
const { needsE2eTesting } = result
const needsCypress = argv.cypress || argv.tests || needsE2eTesting === 'cypress'
const needsCypressCT = needsCypress && !needsVitest
const needsNightwatch = argv.nightwatch || argv.tests || needsE2eTesting === 'nightwatch'
const needsNightwatchCT = needsNightwatch && !needsVitest
const needsPlaywright = argv.playwright || needsE2eTesting === 'playwright'

const root = path.join(cwd, targetDir)
Expand Down Expand Up @@ -329,6 +342,12 @@ async function init() {
if (needsCypressCT) {
render('config/cypress-ct')
}
if (needsNightwatch) {
render('config/nightwatch')
}
if (needsNightwatchCT) {
render('config/nightwatch-ct')
}
if (needsPlaywright) {
render('config/playwright')
}
Expand All @@ -349,6 +368,12 @@ async function init() {
if (needsVitest) {
render('tsconfig/vitest')
}
if (needsNightwatch) {
render('tsconfig/nightwatch')
}
if (needsNightwatchCT) {
render('tsconfig/nightwatch-ct')
}
}

// Render ESLint config
Expand Down Expand Up @@ -393,7 +418,7 @@ async function init() {
root,
() => {},
(filepath) => {
if (filepath.endsWith('.js')) {
if (filepath.endsWith('.js') && !FILES_TO_FILTER.includes(path.basename(filepath))) {
const tsFilePath = filepath.replace(/\.js$/, '.ts')
if (fs.existsSync(tsFilePath)) {
fs.unlinkSync(filepath)
Expand Down Expand Up @@ -437,7 +462,9 @@ async function init() {
needsTypeScript,
needsVitest,
needsCypress,
needsNightwatch,
needsPlaywright,
needsNightwatchCT,
needsCypressCT,
needsEslint
})
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /