Skip to content

Commit

Permalink
workflow: separate unit and e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 15, 2021
1 parent 635d88a commit 7c11c58
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build",
"lint": "eslint --ext .ts packages/*/src/**.ts",
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
"test": "node scripts/build.js vue -f global -d && jest --runInBand",
"test": "run-s test-unit test-e2e",
"test-unit": "jest --filter ./scripts/filter-unit.js",
"test-e2e": "node scripts/build.js vue -f global -d && jest --filter ./scripts/filter-e2e.js --runInBand",
"test-dts": "node scripts/build.js shared reactivity runtime-core runtime-dom -dt -f esm-bundler && npm run test-dts-only",
"test-dts-only": "tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.build.json",
"release": "node scripts/release.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/__tests__/TransitionGroup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ describe('e2e: TransitionGroup', () => {
)
// not sure why but we just have to wait really long for this to
// pass consistently :/
await transitionFinish(duration * 4)
await transitionFinish(duration * 4 + buffer)
expect(await html('#container')).toBe(
`<div class="" style="">a</div>` +
`<div class="" style="">b</div>` +
Expand Down
11 changes: 11 additions & 0 deletions scripts/filter-e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const e2eTests = ['/Transition', '/TransitionGroup', '/examples/']

module.exports = list => {
return {
filtered: list
.filter(t => e2eTests.some(tt => t.includes(tt)))
.map(test => ({ test }))
}
}

module.exports.e2eTests = e2eTests
9 changes: 9 additions & 0 deletions scripts/filter-unit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { e2eTests } = require('./filter-e2e')

module.exports = list => {
return {
filtered: list
.filter(t => !e2eTests.some(tt => t.includes(tt)))
.map(test => ({ test }))
}
}

0 comments on commit 7c11c58

Please sign in to comment.