从Mocha迁移到Jest(Vue.js)后,配置失败

时间:2018-07-11 11:51:54

标签: migration mocha jestjs configuration-files

最近,我从Mocha迁移到Jest。这个过程并不难,但是配置却很困难。我正在与手动配置进行战斗..但缺少某些内容,几乎不需要帮助。

共享我的终端!

失败测试/单位/组件/常规/按钮/NextCancelTest.spec.ts   NextCancelTest.vue     ×检查组件是否存在(28ms)     ×检查有两个按钮(12毫秒)     ×检查最初两个按钮是否均已启用(9毫秒)     ×启用时检查两个按钮触发事件(7毫秒)     ×检查两个按钮均处于禁用状态(8毫秒)时不触发事件

●NextCancelTest.vue›检查组件是否存在

RangeError: Maximum call stack size exceeded
    at Array.forEach (<anonymous>)

  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9

●NextCancelTest.vue›检查组件是否存在

expect(received).toBeDefined()

Received: undefined

  23 |
  24 |   test("checks the component exists", () => {
> 25 |     expect(wrapper).toBeDefined();
     |                                   ^
  26 |   });
  27 |
  28 |   test("checks there are two buttons", () => {

  at Object.<anonymous> (tests/unit/components/general/buttons/NextCancelTest.spec.ts:25:35)

●NextCancelTest.vue›检查是否有两个按钮

RangeError: Maximum call stack size exceeded
    at Array.forEach (<anonymous>)

  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9

●NextCancelTest.vue›检查是否有两个按钮

TypeError: Cannot read property 'findAll' of undefined

  27 |
  28 |   test("checks there are two buttons", () => {
> 29 |     var buttons = wrapper.findAll('button');
     |                           ^
  30 |     expect(buttons.length).toBe(2);
  31 |   });
  32 |

  at Object.<anonymous> (tests/unit/components/general/buttons/NextCancelTest.spec.ts:29:27)

●NextCancelTest.vue›首先检查两个按钮是否已启用

RangeError: Maximum call stack size exceeded
    at Array.forEach (<anonymous>)

  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9

●NextCancelTest.vue›首先检查两个按钮是否已启用

TypeError: Cannot read property 'findAll' of undefined

  32 |
  33 |   test("checks initially both buttons are enabled", () => {
> 34 |     var buttons = wrapper.findAll('button');
     |                           ^
  35 |     buttons.at(0).trigger('click');
  36 |     buttons.at(1).trigger('click');
  37 |     expect(wrapper.vm.isNextInitEnabled()).toBe(true);

  at Object.<anonymous> (tests/unit/components/general/buttons/NextCancelTest.spec.ts:34:27)

●NextCancelTest.vue›启用时检查两个按钮触发事件

RangeError: Maximum call stack size exceeded
    at Array.forEach (<anonymous>)

  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4478:5)
  at node_modules/@vue/test-utils/dist/vue-test-utils.js:4468:9
      at Array.forEach (<anonymous>)
  at compileTemplate (node_modules/@vue/test-utils/dist/vue-test-utils.js:4465:39)

●NextCancelTest.vue›检查两个按钮在禁用时均不会触发事件

TypeError: Cannot read property 'setData' of undefined

  53 |
  54 |   test("checks both buttons NOT fire event when disable", () => {
> 55 |     wrapper.setData({ disabledNext: true, disabledCancel: true });
     |             ^
  56 |
  57 |     var buttons = wrapper.findAll('button');
  58 |

  at Object.<anonymous> (tests/unit/components/general/buttons/NextCancelTest.spec.ts:55:13)

Test Suites: 1 failed, 1 total
Tests:       5 failed, 5 total
Snapshots:   0 total
Time:        4.075s
Ran all test suites.
 ERROR  jest exited with code 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! business-web@0.1.0 test:unit: `vue-cli-service test:unit`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the business-web@0.1.0 test:unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lhmkib1\AppData\Roaming\npm-cache\_logs\2018-07-11T11_45_13_200Z-debug.log
PS C:\src\business-web_new\business-web>
PS C:\src\business-web_new\business-web>     RangeError: Maximum call stac

0 个答案:

没有答案