Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue Cli 4.0.5 Mocha : Unable to run a test #10789

Closed
nicolas15000 opened this issue Nov 2, 2019 · 3 comments

Comments

@nicolas15000
Copy link

@nicolas15000 nicolas15000 commented Nov 2, 2019

Version

2.6.10

Reproduction link

http://random.com

Steps to reproduce

This will be easy to resolve for some of you i guess .

Installed a vue app like this on windows 10:

vue create hello-world

I have chosen Mocha as a test system ,The "tests" directory is present, with an example unit test called example.spec.js

Then

cd hello-world

Then

npm run test

This is the error :


> hello-world@0.1.0 test C:\UwAmp\www\hello-world
> echo 'Error: no test specified'


'Error: no test specified'

This is my vue-cli version :


vue --version
@vue/cli 4.0.5

This is my package.json file , not modified :

{
  "name": "hello-world",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.3.2",
    "vue": "^2.6.10",
    "vue-router": "^3.1.3"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.0.0",
    "@vue/cli-plugin-eslint": "^4.0.0",
    "@vue/cli-plugin-router": "^4.0.0",
    "@vue/cli-plugin-unit-mocha": "^4.0.0",
    "@vue/cli-service": "^4.0.0",
    "@vue/test-utils": "1.0.0-beta.29",
    "babel-eslint": "^10.0.3",
    "chai": "^4.1.2",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "vue-template-compiler": "^2.6.10"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "overrides": [
      {
        "files": [
          "**/__tests__/*.{j,t}s?(x)"
        ],
        "env": {
          "mocha": true
        }
      }
    ]
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

What is expected?

testing

What is actually happening?

nothing

@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Nov 2, 2019

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.
This is also related to vue-cli (which has its own repository). If it ends up being a bug, you should open an issue there or the relevant repo causing the bug

@posva posva closed this Nov 2, 2019
@edreesjalili

This comment has been minimized.

Copy link

@edreesjalili edreesjalili commented Nov 2, 2019

@nicolas15000 Looking at the package.json scripts, looks like you'll actually want to run
npm run test:unit

@nicolas15000

This comment has been minimized.

Copy link
Author

@nicolas15000 nicolas15000 commented Nov 2, 2019

Thank you a lot edreesjalili, it is working with your command .

I've also used this command on win 10 64 and now, it is working too :

npx vue-cli-service test:unit

Please notice npx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.