]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow: separate unit and e2e tests
authorEvan You <yyx990803@gmail.com>
Mon, 15 Nov 2021 04:14:57 +0000 (12:14 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 15 Nov 2021 04:14:57 +0000 (12:14 +0800)
package.json
packages/vue/__tests__/TransitionGroup.spec.ts
scripts/filter-e2e.js [new file with mode: 0644]
scripts/filter-unit.js [new file with mode: 0644]

index fcfd1f52d19d0fb5b8ed68c4ed22c63b13abcd16..ad57f52b8fdb8e71ffae1f62dc2af7b3b6ae7bbb 100644 (file)
@@ -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",
index 6ba057638018bda1cc018aaf20420f0a5238c853..38d742538a2b02fa10dda599cf9bb3cc7595f34d 100644 (file)
@@ -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>` +
diff --git a/scripts/filter-e2e.js b/scripts/filter-e2e.js
new file mode 100644 (file)
index 0000000..bbc3602
--- /dev/null
@@ -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
diff --git a/scripts/filter-unit.js b/scripts/filter-unit.js
new file mode 100644 (file)
index 0000000..d752807
--- /dev/null
@@ -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 }))
+  }
+}