Testing Vue Class Component Integration in vue-cli TypeScript Plugin
This test suite validates the Vue Class Component functionality within the Vue CLI TypeScript plugin. It focuses on verifying proper class-based component syntax and build integration for TypeScript-enabled Vue applications.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
vuejs/vue-cli
packages/@vue/cli-plugin-typescript/__tests__/tsPluginClassComponent.spec.js
jest.setTimeout(30000)
const { assertServe, assertBuild } = require('./tsPlugin.helper')
const options = {
plugins: {
'@vue/cli-plugin-typescript': {
classComponent: true
}
}
}
assertServe('ts-class-serve', options)
assertBuild('ts-class-build', options, async (project) => {
const app = await project.read('src/App.vue')
expect(app).toMatch(`export default class App extends Vue {`)
})