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

feat: update jest to v27 #6627

Merged
merged 3 commits into from
Sep 15, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
fix: remove unit-jest badly placed Vue 3 tests
  • Loading branch information
cexbrayat committed Sep 10, 2021
commit 3b4ff7e7b1709b663e7d7250849b80e781fbc582
33 changes: 0 additions & 33 deletions packages/@vue/cli-plugin-unit-jest/__tests__/jestPlugin.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
jest.setTimeout(300000)

const create = require('@vue/cli-test-utils/createTestProject')
const createOutside = require('@vue/cli-test-utils/createUpgradableProject')

test('should work', async () => {
const project = await create('unit-jest', {
Expand Down Expand Up @@ -126,35 +125,3 @@ test('should correctly configured eslint', async () => {
})
await project.run(`vue-cli-service lint`)
})

test('should work with Vue 3', async () => {
const project = await createOutside('unit-jest-vue-3', {
vueVersion: '3',
plugins: {
'@vue/cli-plugin-babel': {},
'@vue/cli-plugin-unit-jest': {}
}
})
const pkg = JSON.parse(await project.read('package.json'))
expect(pkg.devDependencies['@vue/test-utils']).toMatch('^2')
expect(pkg.devDependencies['@vue/vue3-jest']).toMatch('^27')
expect(pkg.devDependencies.jest).toMatch('^27')
expect(pkg.devDependencies['babel-jest']).toMatch('^27')
await project.run(`vue-cli-service test:unit`)
})

test('should work with Vue 3 and TS', async () => {
const project = await createOutside('unit-jest-vue-3-ts', {
vueVersion: '3',
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cli-plugin-unit-jest': {}
}
})
const pkg = JSON.parse(await project.read('package.json'))
expect(pkg.devDependencies['@vue/test-utils']).toMatch('^2')
expect(pkg.devDependencies['@vue/vue3-jest']).toMatch('^27')
expect(pkg.devDependencies.jest).toMatch('^27')
expect(pkg.devDependencies['ts-jest']).toMatch('^27')
await project.run(`vue-cli-service test:unit`)
})