We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The last version 1.0.5 use wrapper.vm change the data, but the wrapper element text was old text
the test.vue `
methods: { increment () { this.count++; } } }; </script>`
the test unit `import { shallowMount } from '@vue/test-utils'; import Test from '@/components/test';
describe('Test Components', () => { let wrapper; // 每个it开始之前执行 beforeEach(() => { // 初始化wrapper wrapper = shallowMount(Test); }); // 每个it结束时执行 afterEach(() => { // 销毁wrapper wrapper.destroy(); });
it('show and hide', () => { const text = wrapper.find('.testText'); expect(text.text()).toBe('a'); wrapper.vm.testValue = false; expect(text.text()).toBe('b'); }); });`
use @vue/test-utils 1.0.5
the unit test is failed
use 1.0.0-beta.29 is passed
The text was updated successfully, but these errors were encountered:
use setData() method solve
Sorry, something went wrong.
No branches or pull requests
Subject of the issue
The last version 1.0.5 use wrapper.vm change the data, but the wrapper element text was old text
Steps to reproduce
the test.vue
`
methods: {
increment () {
this.count++;
}
}
};
</script>`
the test unit
`import { shallowMount } from '@vue/test-utils';
import Test from '@/components/test';
describe('Test Components', () => {
let wrapper;
// 每个it开始之前执行
beforeEach(() => {
// 初始化wrapper
wrapper = shallowMount(Test);
});
// 每个it结束时执行
afterEach(() => {
// 销毁wrapper
wrapper.destroy();
});
it('show and hide', () => {
const text = wrapper.find('.testText');
expect(text.text()).toBe('a');
wrapper.vm.testValue = false;
expect(text.text()).toBe('b');
});
});`
Expected behaviour
use @vue/test-utils 1.0.5
Actual behaviour
the unit test is failed
Possible Solution
use 1.0.0-beta.29 is passed
The text was updated successfully, but these errors were encountered: