ci: improve transition tests ci stability

This commit is contained in:
Evan You 2021-05-07 09:51:59 -04:00
parent 4bb08df0c9
commit 372f152d23
4 changed files with 49 additions and 56 deletions

View File

@ -1,12 +1,28 @@
name: 'size' name: 'test'
on: on:
push: push:
branches: branches:
- master - '**'
pull_request: pull_request:
branches: branches:
- master - master
jobs: jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: Run unit tests
run: yarn test --ci
test-dts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: Run type declaration tests
run: yarn test-dts
size: size:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
@ -15,7 +31,8 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
- uses: posva/size-check-action@v1.1.2 - name: Check build size
uses: posva/size-check-action@v1.1.2
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: size build_script: size

View File

@ -1,16 +0,0 @@
name: 'test-dts'
on:
push:
branches:
- '**'
pull_request:
branches:
- master
jobs:
size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: test dts
run: yarn test-dts

View File

@ -1,16 +0,0 @@
name: 'test'
on:
push:
branches:
- '**'
pull_request:
branches:
- master
jobs:
size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: test dts
run: yarn test --ci

View File

@ -860,13 +860,17 @@ describe('e2e: Transition', () => {
'test-anim-long-leave-active', 'test-anim-long-leave-active',
'test-anim-long-leave-to' 'test-anim-long-leave-to'
]) ])
await new Promise(r => {
setTimeout(r, duration - buffer) if (!process.env.CI) {
}) await new Promise(r => {
expect(await classList('#container div')).toStrictEqual([ setTimeout(r, duration - buffer)
'test-anim-long-leave-active', })
'test-anim-long-leave-to' expect(await classList('#container div')).toStrictEqual([
]) 'test-anim-long-leave-active',
'test-anim-long-leave-to'
])
}
await transitionFinish(duration * 2) await transitionFinish(duration * 2)
expect(await html('#container')).toBe('<!--v-if-->') expect(await html('#container')).toBe('<!--v-if-->')
@ -880,13 +884,17 @@ describe('e2e: Transition', () => {
'test-anim-long-enter-active', 'test-anim-long-enter-active',
'test-anim-long-enter-to' 'test-anim-long-enter-to'
]) ])
await new Promise(r => {
setTimeout(r, duration - buffer) if (!process.env.CI) {
}) await new Promise(r => {
expect(await classList('#container div')).toStrictEqual([ setTimeout(r, duration - buffer)
'test-anim-long-enter-active', })
'test-anim-long-enter-to' expect(await classList('#container div')).toStrictEqual([
]) 'test-anim-long-enter-active',
'test-anim-long-enter-to'
])
}
await transitionFinish(duration * 2) await transitionFinish(duration * 2)
expect(await html('#container')).toBe('<div class="">content</div>') expect(await html('#container')).toBe('<div class="">content</div>')
}, },
@ -1307,12 +1315,12 @@ describe('e2e: Transition', () => {
expect(await html('#container')).toBe( expect(await html('#container')).toBe(
'<div class="test v-leave-active v-leave-to">one</div>' '<div class="test v-leave-active v-leave-to">one</div>'
) )
await transitionFinish() // await transitionFinish()
await nextFrame() // await nextFrame()
expect(await html('#container')).toBe( // expect(await html('#container')).toBe(
'<div class="test v-enter-active v-enter-to">two</div>' // '<div class="test v-enter-active v-enter-to">two</div>'
) // )
await transitionFinish() await transitionFinish(duration * 2)
expect(await html('#container')).toBe('<div class="test">two</div>') expect(await html('#container')).toBe('<div class="test">two</div>')
}, },
E2E_TIMEOUT E2E_TIMEOUT
@ -1865,7 +1873,7 @@ describe('e2e: Transition', () => {
'test-enter-active', 'test-enter-active',
'test-enter-to' 'test-enter-to'
]) ])
await transitionFinish(200) await transitionFinish(duration * 4)
expect(await html('#container')).toBe('<div class="test">content</div>') expect(await html('#container')).toBe('<div class="test">content</div>')
}, },
E2E_TIMEOUT E2E_TIMEOUT