Movatterモバイル変換


[0]ホーム

URL:


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

fix: nightwatch integration#386

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
haoqunjiang merged 1 commit intovuejs:mainfromcexbrayat:fix/nighwatch
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
9 changes: 5 additions & 4 deletionspnpm-lock.yaml
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

23 changes: 18 additions & 5 deletionsscripts/test.mjs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env zx
import 'zx/globals'

// Vitest would otherwise enable watch mode by default.
process.env.CI = '1'

const playgroundDir = path.resolve(__dirname, '../playground/')
let projects = fs
.readdirSync(playgroundDir, { withFileTypes: true })
Expand All@@ -21,7 +18,13 @@ for (const projectName of projects) {
cd(path.resolve(playgroundDir, projectName))
const packageJSON = require(path.resolve(playgroundDir, projectName, 'package.json'))

console.log(`Building ${projectName}`)
console.log(`

#####
Building ${projectName}
#####

`)
await $`pnpm build`

if ('@playwright/test' in packageJSON.devDependencies) {
Expand All@@ -35,6 +38,16 @@ for (const projectName of projects) {

if ('test:unit' in packageJSON.scripts) {
console.log(`Running unit tests in ${projectName}`)
await $`pnpm test:unit`
if (projectName.includes('vitest') || projectName.includes('with-tests')) {
// Vitest would otherwise enable watch mode by default.
await $`CI=1 pnpm test:unit`
} else {
await $`pnpm test:unit`
}
}

if ('type-check' in packageJSON.scripts) {
console.log(`Running type-check in ${projectName}`)
await $`pnpm type-check`
}
}
2 changes: 1 addition & 1 deletiontemplate/base/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,6 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.5.0",
"vite": "^5.0.1"
"vite": "^5.0.2"
}
}
5 changes: 4 additions & 1 deletiontemplate/config/nightwatch-ct/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
{
"scripts": {
"test:unit": "nightwatch src/components/**/__tests__/*"
"test:unit": "nightwatch src/**/__tests__/*"
},
"dependencies": {
"vue": "^3.3.8"
},
"devDependencies": {
"@vue/test-utils": "^2.4.2"
}
}
5 changes: 3 additions & 2 deletionstemplate/config/nightwatch/nightwatch.conf.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,10 +30,11 @@ module.exports = {
plugins: ['@nightwatch/vue'],

// See https://nightwatchjs.org/guide/concepts/test-globals.html#external-test-globals
globals_path: 'nightwatch/globals.js',
globals_path: '',

vite_dev_server: {
start_vite: false
start_vite: true,
port: process.env.CI ? 4173 : 5173
},

webdriver: {},
Expand Down
23 changes: 0 additions & 23 deletionstemplate/config/nightwatch/nightwatch/globals.js
View file
Open in desktop

This file was deleted.

5 changes: 2 additions & 3 deletionstemplate/config/nightwatch/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"test:e2e": "nightwatch tests/e2e"
"test:e2e": "nightwatch tests/e2e/*"
},
"devDependencies": {
"nightwatch": "^3.3.2",
Expand All@@ -9,7 +9,6 @@
"@types/nightwatch": "^2.3.28",
"geckodriver": "^4.2.1",
"chromedriver": "^119.0.0",
"ts-node": "^10.9.1",
"wait-on": "^7.2.0"
"ts-node": "^10.9.1"
}
}
5 changes: 1 addition & 4 deletionstemplate/config/nightwatch/tests/e2e/example.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,10 +4,7 @@ describe('My First Test', function () {
})

it('visits the app root url', function () {
browser.assert
.textContains('.green', 'You did it!')
.assert.elementHasCount('.wrapper nav a', 2)
.strictClick('.wrapper nav a:last-child')
browser.assert.textContains('.green', 'You did it!')
})

after((browser) => browser.end())
Expand Down
3 changes: 2 additions & 1 deletiontemplate/tsconfig/nightwatch/nightwatch/tsconfig.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,14 +3,15 @@
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"moduleResolution": "node",
"composite": true,
"rootDir": "../",
"lib": ["ESNext", "dom"],
"types": ["nightwatch"]
},
"include": ["../node_modules/@nightwatch/**/*", "../src/components/**/*", "../tests/e2e/**/*"],
"ts-node": {
"files": true
"transpileOnly": true
},
"files": ["nightwatch.d.ts"]
}
6 changes: 1 addition & 5 deletionsutils/filterList.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
export const FILES_TO_FILTER = [
'nightwatch.e2e.conf.js',
'nightwatch.component.conf.js',
'globals.js'
]
export const FILES_TO_FILTER = ['nightwatch.e2e.conf.js', 'nightwatch.component.conf.js']

[8]ページ先頭

©2009-2025 Movatter.jp