Closed theNewFlesh closed 6 years ago
Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!
When I switch the import from "vue-test-utils" to "@vue/test-utils" one of my tests breaks.
wrapper.emitted() resolves to undefined in the latter case, and I get an "TypeError: undefined is not an object" error
Given that:
the only changes to my code is the import statement it follows that it is something to do with @vue/test-utils itself.
here is the component: `
`
here is the test: `import Vue from "vue"; import Timeline from "../src/components/Timeline.vue";
import as vtu from "@vue/test-utils"; import as utils from "../../tools/utils"; // -----------------------------------------------------------------------------
/ convenience function for getting a good timeline instance @return a wrapped Timeline mounted with easily testable prop data / function getWrapper1(): any { return vtu.mount(Timeline, { propsData: { inPoint: 2, outPoint: 6, step: 2, displayMarkers: true } } ); }
/ like getWrapper1, but with props that make testing tick and tickStep easy @return a wrapped Timeline mounted with easily testable prop data / function getWrapper2(): any { return vtu.mount(Timeline, { propsData: { inPoint: 0, outPoint: 100, step: 1, displayMarkers: true } } ); } // -----------------------------------------------------------------------------
describe('Timeline', () => { describe("events", () => { const wrapper = getWrapper1();
}); `