Skip to content

Commit

Permalink
chore: run tests in random order
Browse files Browse the repository at this point in the history
This fixes issues of some tests relying on others to run first.
  • Loading branch information
cexbrayat committed Sep 3, 2022
1 parent 2747a18 commit 5f7b955
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions tests/features/compat.spec.ts
Expand Up @@ -165,6 +165,12 @@ describe('@vue/compat build', () => {
})

it('wrapper.vm points to correct instance when component is wrapped with Vue.extend', () => {
configureCompat({
MODE: 3,
GLOBAL_EXTEND: 'suppress-warning',
GLOBAL_MOUNT: 'suppress-warning'
})

const Component = extend({
data() {
return { foo: 'bar' }
Expand Down
6 changes: 5 additions & 1 deletion tests/features/suspense.spec.ts
@@ -1,4 +1,4 @@
import { describe, expect, test, vi } from 'vitest'
import { beforeEach, describe, expect, test, vi } from 'vitest'
import SuspenseComponent from '../components/Suspense.vue'
import { mount, flushPromises } from '../../src'
import { defineComponent } from 'vue'
Expand All @@ -12,6 +12,10 @@ vi.mock('../utils', () => ({
}
}))

beforeEach(() => {
mockShouldError = false
})

describe('suspense', () => {
test('fallback state', () => {
const wrapper = mount(SuspenseComponent)
Expand Down
10 changes: 5 additions & 5 deletions tests/mountingOptions/global.stubs.spec.ts
Expand Up @@ -395,19 +395,19 @@ describe('mounting options: stubs', () => {

describe('transition', () => {
it('stubs transition by default', () => {
const Comp = {
template: `<transition><div id="content" /></transition>`
const CompStubbedByDefault = {
template: `<transition><div id="content-stubbed-by-default" /></transition>`
}
const wrapper = mount(Comp)
const wrapper = mount(CompStubbedByDefault)

expect(wrapper.html()).toBe(
'<transition-stub>\n' +
' <div id="content"></div>\n' +
' <div id="content-stubbed-by-default"></div>\n' +
'</transition-stub>'
)
})

it('opts out of stubbing transition by default', () => {
it('opts out of stubbing transition', () => {
const Comp = {
template: `<transition><div id="content" /></transition>`
}
Expand Down
3 changes: 3 additions & 0 deletions vitest.config.ts
Expand Up @@ -16,6 +16,9 @@ export default defineConfig({
include: ['tests/**/*.spec.ts'],
deps: {
inline: ['vue', '@vue/compat']
},
sequence: {
shuffle: true
}
},
resolve: {
Expand Down

0 comments on commit 5f7b955

Please sign in to comment.