Skip to content

Cannot convert undefined or null to object #853

Closed
@caugner

Description

@caugner

Version

1.0.0-beta.21

Reproduction link

https://gitlab/mygroup/myproject

Steps to reproduce

import { shallowMount } from "@vue/test-utils";
import { expect } from "chai";
import App from "@/App";
import router from "@/router";
import i18n from "@/i18n";

describe("App.vue", function() {
  let wrapper;

  beforeEach(() => {
    wrapper = shallowMount(App, {
      router,
      i18n
    });
  });

  //...

});

What is expected?

The tests should pass (like they did in 1.0.0-beta.20).

What is actually happening?

     TypeError: Cannot convert undefined or null to object
      at /builds/mygroup/myproject/dist/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.js:2447:1
      at Array.forEach (<anonymous>)
      at stubComponents (dist/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.js:2441:1)
      at createComponentStubsForAll (dist/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.js:2459:1)
      at shallowMount (dist/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.js:5522:1)
      at Context.<anonymous> (dist/webpack:/tests/unit/specs/App.spec.js:11:1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions