Skip to content

Tests are not found out of the box #1686

Closed
@lmiller1990

Description

@lmiller1990

Version

3.0.0-rc.3

Reproduction link

https://would-not-be-useful.com could not find a good way to do this - I think it must be related to some other setting.

Steps to reproduce

vue create test_app -> choose babel and jest

yarn unit:test
yarn run v1.7.0
$ vue-cli-service test:unit
No tests found
In /Users/lachlanmiller/javascript/vue/qiita_post
  10 files checked.
  testMatch: /Users/lachlanmiller/javascript/vue/qiita_post/(tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)) - 0 matches
  testPathIgnorePatterns: /node_modules/ - 10 matches
Pattern:  - 0 matches
 ERROR  jest exited with code 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What is expected?

It runs HelloWorld.spec.js

What is actually happening?

It does not find the test


MacOS 10.13.2 High Sierra
Happening on another machine (not sure of the macOS version for it, but it's high sierra). I can check the version tomorrow. I tried using both npm and yarn, and jest directly.

I tried both with jest config in package.json and standalone.

Also I cannot specify either:

yarn test:unit --  --runTestsByPath tests/unit/HelloWorld.spec.js

> vue-cli-service test:unit "--runTestsByPath" "tests/unit/HelloWorld.spec.js"

No tests found
No files found in /Users/lachlanmiller/javascript/vue/qiita_post.
Make sure Jest's configuration does not exclude this directory.
To set up Jest, make sure a package.json file exists.
Jest Documentation: facebook.github.io/jest/docs/configuration.html
Files: "tests/unit/HelloWorld.spec.js"

HOWEVER git cloning a project scaffolded on another PC works somehow.

Other projects on my machine are using jest no problem. Not sure what's going on. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions