Our team is in the process of developing an application using VueJs. Drawing from our past experience with Angular unit testing utilizing Jasmine and Karma, we have opted to implement Typescript for this VueJs project.
Currently, I have created simple specifications for components; however, it appears that the components are not being mounted as expected.
Below is a snippet of a sample component:
export default class TableOverview extends Vue {
public mounted() {
console.log("mounted");
}
}
And here's my test specification:
describe("table-overview.vue", () => {
it("should log 'mounted'", () => {
const wrapper = mount(TableOverview);
expect(wrapper).toBeDefined();
});
});
However, nothing seems to be displaying in the console log.
What could possibly be missing? This particular project was initialized using Vue CLI v4.3.1.
Here is some additional Vue information for reference:
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Node: 8.11.3 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.18362.449.0
npmPackages:
...