Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run tests in random order #1747

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/features/compat.spec.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default defineConfig({
include: ['tests/**/*.spec.ts'],
deps: {
inline: ['vue', '@vue/compat']
},
sequence: {
shuffle: true
}
},
resolve: {
Expand Down