Testing TypeScript Plugin Integration with Jest in vue-cli
This test suite validates the TypeScript plugin integration with Jest testing in Vue CLI. It ensures proper functionality of TypeScript-based unit testing setups, both with and without Babel transpilation support.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
vuejs/vue-cli
packages/@vue/cli-plugin-typescript/__tests__/tsPluginUnit.spec.js
jest.setTimeout(40000)
const create = require('@vue/cli-test-utils/createTestProject')
test('jest', async () => {
const project = await create('ts-unit-jest', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cli-plugin-unit-jest': {}
}
})
await project.run(`vue-cli-service test:unit`)
})
test('jest w/ babel', async () => {
const project = await create('ts-unit-jest-babel', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cli-plugin-babel': {},
'@vue/cli-plugin-unit-jest': {}
}
})
await project.run(`vue-cli-service test:unit`)
})