create-vike 0.0.307 → 0.0.308
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.testRun.ts
CHANGED
|
@@ -27,10 +27,11 @@ function testRun(
|
|
|
27
27
|
isSPA?: true
|
|
28
28
|
}
|
|
29
29
|
) {
|
|
30
|
-
run(cmd)
|
|
31
|
-
|
|
32
30
|
const isProd = cmd === 'npm run prod' || cmd === 'npm run preview'
|
|
33
31
|
const isDev = !isProd
|
|
32
|
+
const testHMR = isDev && (uiFramewok === 'react' || uiFramewok === 'vue')
|
|
33
|
+
|
|
34
|
+
run(cmd, { isFlaky: testHMR })
|
|
34
35
|
|
|
35
36
|
test('page content is rendered to HTML', async () => {
|
|
36
37
|
const html = await fetchHtml('/')
|
|
@@ -56,7 +57,7 @@ function testRun(
|
|
|
56
57
|
})
|
|
57
58
|
})
|
|
58
59
|
|
|
59
|
-
if (
|
|
60
|
+
if (testHMR) {
|
|
60
61
|
test('HMR', async () => {
|
|
61
62
|
const file = (() => {
|
|
62
63
|
if (uiFramewok === 'vue') {
|
|
@@ -73,13 +74,11 @@ function testRun(
|
|
|
73
74
|
})()
|
|
74
75
|
expect(await page.textContent('button')).toBe('Counter 1')
|
|
75
76
|
expect(await page.textContent('h1')).toBe('Welcome')
|
|
76
|
-
await sleep(2 * 1000) // timeout can probably be decreased
|
|
77
77
|
editFile(file, (s) => s.replace('Welcome', 'Welcome !'))
|
|
78
78
|
await autoRetry(async () => {
|
|
79
79
|
expect(await page.textContent('h1')).toBe('Welcome !')
|
|
80
80
|
})
|
|
81
81
|
expect(await page.textContent('button')).toBe('Counter 1')
|
|
82
|
-
await sleep(300)
|
|
83
82
|
editFileRevert()
|
|
84
83
|
await autoRetry(async () => {
|
|
85
84
|
expect(await page.textContent('h1')).toBe('Welcome')
|