Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
VueJS borked tests
➜ git:(vueJS-user-list) ✗ yarn test
yarn run v1.3.2
$ jest --config spec/vue/jest.conf.json
FAIL spec/vue/users-add-remove.spec.js
UsersAddRemove
✕ loads users from remote JSON endpoint and renders table (1531ms)
● UsersAddRemove › loads users from remote JSON endpoint and renders table
expect(string).toContain(value)
Expected string:
"<div class=\"users-list\"><div class=\" autocomplete-wrapper\"><input type=\"text\" placeholder=\"Search for users to add\" autocomplete=\"off\" class=\"form-control input-lg autocomplete-input\"> <div class=\" autocomplete autocomplete-list\" style=\"display: none;\"><ul></ul></div></div> <v-client-table data=\"[object Object]\" columns=\"email,remove\" options=\"[object Object]\" class=\"\"></v-client-table></div>"
To contain value:
"<td class=\"\">brayan@schaeferkshlerin1.net</td>"
58 | });
59 |
> 60 | // it('removes a user from the list', () => {
61 | // const wrapper = mount(UsersAddRemove, { propsData: PROPS_DATA });
62 | // moxios.wait(() => {
63 | // expect(wrapper.html()).toContain('<td class="">brayan@schaeferkshlerin.net</td>');
at users-add-remove.spec.js:60:30
at Timeout.callback [as _onTimeout] (../../node_modules/jsdom/lib/jsdom/browser/Window.js:633:19)
console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29
Error: Uncaught [Error: expect(string).toContain(value)
Expected string:
"<div class=\"users-list\"><div class=\" autocomplete-wrapper\"><input type=\"text\" placeholder=\"Search for users to add\" autocomplete=\"off\" class=\"form-control input-lg autocomplete-input\"> <div class=\" autocomplete autocomplete-list\" style=\"display: none;\"><ul></ul></div></div> <v-client-table data=\"[object Object]\" columns=\"email,remove\" options=\"[object Object]\" class=\"\"></v-client-table></div>"
To contain value:
"<td class=\"\">brayan@schaeferkshlerin1.net</td>"]
at reportException (/Users/constantmeiring/WebDev/popcorn-cloud/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
at Timeout.callback [as _onTimeout] (/Users/constantmeiring/WebDev/popcorn-cloud/node_modules/jsdom/lib/jsdom/browser/Window.js:635:7)
at ontimeout (timers.js:466:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:267:5) { Error: expect(string).toContain(value)
Expected string:
"<div class=\"users-list\"><div class=\" autocomplete-wrapper\"><input type=\"text\" placeholder=\"Search for users to add\" autocomplete=\"off\" class=\"form-control input-lg autocomplete-input\"> <div class=\" autocomplete autocomplete-list\" style=\"display: none;\"><ul></ul></div></div> <v-client-table data=\"[object Object]\" columns=\"email,remove\" options=\"[object Object]\" class=\"\"></v-client-table></div>"
To contain value:
"<td class=\"\">brayan@schaeferkshlerin1.net</td>"
at /Users/constantmeiring/WebDev/popcorn-cloud/spec/vue/users-add-remove.spec.js:60:30
at Timeout.callback [as _onTimeout] (/Users/constantmeiring/WebDev/popcorn-cloud/node_modules/jsdom/lib/jsdom/browser/Window.js:633:19)
at ontimeout (timers.js:466:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:267:5) matcherResult: { message: [Function], pass: false } }
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 3.371s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment