Skip to content

Commit 7c11c58

Browse files
committed
workflow: separate unit and e2e tests
1 parent 635d88a commit 7c11c58

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build",
1010
"lint": "eslint --ext .ts packages/*/src/**.ts",
1111
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
12-
"test": "node scripts/build.js vue -f global -d && jest --runInBand",
12+
"test": "run-s test-unit test-e2e",
13+
"test-unit": "jest --filter ./scripts/filter-unit.js",
14+
"test-e2e": "node scripts/build.js vue -f global -d && jest --filter ./scripts/filter-e2e.js --runInBand",
1315
"test-dts": "node scripts/build.js shared reactivity runtime-core runtime-dom -dt -f esm-bundler && npm run test-dts-only",
1416
"test-dts-only": "tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.build.json",
1517
"release": "node scripts/release.js",

packages/vue/__tests__/TransitionGroup.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ describe('e2e: TransitionGroup', () => {
346346
)
347347
// not sure why but we just have to wait really long for this to
348348
// pass consistently :/
349-
await transitionFinish(duration * 4)
349+
await transitionFinish(duration * 4 + buffer)
350350
expect(await html('#container')).toBe(
351351
`<div class="" style="">a</div>` +
352352
`<div class="" style="">b</div>` +

scripts/filter-e2e.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const e2eTests = ['/Transition', '/TransitionGroup', '/examples/']
2+
3+
module.exports = list => {
4+
return {
5+
filtered: list
6+
.filter(t => e2eTests.some(tt => t.includes(tt)))
7+
.map(test => ({ test }))
8+
}
9+
}
10+
11+
module.exports.e2eTests = e2eTests

scripts/filter-unit.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { e2eTests } = require('./filter-e2e')
2+
3+
module.exports = list => {
4+
return {
5+
filtered: list
6+
.filter(t => !e2eTests.some(tt => t.includes(tt)))
7+
.map(test => ({ test }))
8+
}
9+
}

0 commit comments

Comments
 (0)