From b983c685755774f7b9c89264841c3029647fe7cc Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 11 Dec 2019 10:37:03 -0500 Subject: [PATCH] test(e2e): avoid relying on CDN + reduce debounce delay --- packages/vue/examples/__tests__/markdown.spec.ts | 4 ++-- packages/vue/examples/classic/markdown.html | 8 +++++--- packages/vue/examples/classic/todomvc.html | 2 +- packages/vue/examples/composition/markdown.html | 7 ++++--- packages/vue/examples/composition/todomvc.html | 2 +- packages/vue/examples/transition/list.html | 2 +- packages/vue/package.json | 5 +++++ yarn.lock | 12 +++++++++++- 8 files changed, 30 insertions(+), 12 deletions(-) diff --git a/packages/vue/examples/__tests__/markdown.spec.ts b/packages/vue/examples/__tests__/markdown.spec.ts index 196f7200..6b248cb5 100644 --- a/packages/vue/examples/__tests__/markdown.spec.ts +++ b/packages/vue/examples/__tests__/markdown.spec.ts @@ -7,7 +7,7 @@ describe('e2e: markdown', () => { async function testMarkdown(apiType: 'classic' | 'composition') { const baseUrl = `file://${path.resolve( __dirname, - `../${apiType}/markdown.html` + `../${apiType}/markdown.html#test` )}` await page().goto(baseUrl) @@ -18,7 +18,7 @@ describe('e2e: markdown', () => { await page().type('textarea', '\n## foo\n\n- bar\n- baz') // assert the output is not updated yet because of debounce expect(await html('#editor div')).toBe('

hello

\n') - await page().waitFor(500) + await page().waitFor(16) expect(await html('#editor div')).toBe( '

hello

\n' + '

foo

\n' + diff --git a/packages/vue/examples/classic/markdown.html b/packages/vue/examples/classic/markdown.html index c30c9655..afca4ef0 100644 --- a/packages/vue/examples/classic/markdown.html +++ b/packages/vue/examples/classic/markdown.html @@ -1,5 +1,5 @@ - - + +
@@ -8,6 +8,8 @@
- +
diff --git a/packages/vue/examples/composition/markdown.html b/packages/vue/examples/composition/markdown.html index 9a75d45e..1a292190 100644 --- a/packages/vue/examples/composition/markdown.html +++ b/packages/vue/examples/composition/markdown.html @@ -1,5 +1,5 @@ - - + +
@@ -8,13 +8,14 @@
- +
diff --git a/packages/vue/examples/transition/list.html b/packages/vue/examples/transition/list.html index 6236a8ac..5535d656 100644 --- a/packages/vue/examples/transition/list.html +++ b/packages/vue/examples/transition/list.html @@ -1,4 +1,4 @@ - +
diff --git a/packages/vue/package.json b/packages/vue/package.json index a06ab849..f17ccfd6 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -35,5 +35,10 @@ "dependencies": { "@vue/compiler-dom": "3.0.0-alpha.0", "@vue/runtime-dom": "3.0.0-alpha.0" + }, + "devDependencies": { + "lodash": "^4.17.15", + "marked": "^0.7.0", + "todomvc-app-css": "^2.3.0" } } diff --git a/yarn.lock b/yarn.lock index 34b63168..11475711 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3430,7 +3430,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.13.1, lodash@^4.17.13, lodash@^4.17.4, lodash@~4.17.15: +lodash@^4.13.1, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.4, lodash@~4.17.15: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -3568,6 +3568,11 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +marked@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" + integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== + meow@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" @@ -5298,6 +5303,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +todomvc-app-css@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/todomvc-app-css/-/todomvc-app-css-2.3.0.tgz#cc27f1686ab4c418eef4e790289cc124baca2546" + integrity sha512-RG8hxqoVn8Be3wxyuyHfOSAXiY1Z0N+PYQOe/jxzy3wpU1Obfwd1RF1i/fz/fR+MrYL+Q+BdrUt8SsXdtR7Oow== + token-stream@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a"