Skip to content

can't locally run tests due to the vue-test-utils dependency #107

Closed
@justinhelmer

Description

@justinhelmer

The problem

I want to contribute to support the new babel 7 suggested babel.config.js file, and related options (i.e. root). I opened an issue (#110) and PR (#111) related to this, but I had to make this change locally before running tests.

This project's test suite relies on vue-test-utils. Tracing the dependency to this repo's package.json, you can see it points to the master branch of vue-test-utils. The current tip of master has no index.js, and no main entry in it's package.json. Therefore, npm has no way to resolve the dependency. Running the tests results in the following:

$ npm run test             

> vue-jest@2.6.0 test /Volumes/workspace/vue-jest
> npm run lint && ./test.sh


> vue-jest@2.6.0 lint /Volumes/workspace/vue-jest
> eslint lib vue-jest.js test

yarn run v1.6.0
$ jest test --no-cache --runInBand --coverage --coverageDirectory test/coverage
 FAIL  test/scss.spec.js
  ● Test suite failed to run

    Cannot find module 'vue-test-utils' from 'scss.spec.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17)
      at Object.<anonymous> (test/scss.spec.js:1:123)

 FAIL  test/sass.spec.js
  ● Test suite failed to run

    Cannot find module 'vue-test-utils' from 'sass.spec.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17)
      at Object.<anonymous> (test/sass.spec.js:1:123)

# ... more fails for the same reason. Output cut short for the sake of brevity

The solution

Use the published version of @vue/test-utils, and update the tests to support the new API (current version is @vue/test-utils@1.0.0-beta.25)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions