forcedotcom / sfdx-plugin-generate

MIT License
73 stars 19 forks source link

Template Output: `npm run test` gives little output / as if no tests ran. #69

Open zerkz opened 4 years ago

zerkz commented 4 years ago

Summary

On a newly generated plugin template, running tests via npm run test gives weird output (as if no tests ran).

Steps To Reproduce:

  1. Install SFDX, run sfdx plugins:generate. Smash enter/default options.
  2. npm install
  3. npm run test
  4. Get output that looks like this. image

Expected result

See test names, and actual code coverage info.

Actual result

image

Additional information

SFDX CLI Version: sfdx-cli/7.63.0 win32-x64 node-v12.18.1 OS and version: Windows 10 Pro 2004

riteshnahar commented 4 years ago

I am also facing the same issue, any workarounds?

richclark808 commented 4 years ago

@amphro Hi Thomas, don't know if you'd seen this one already but we're looking to publish our DX plugin on NPM and VS Code Extensions this week and this is an issue we've also come across recently.

zerkz commented 4 years ago

I had an old plugin I generated awhile back that IS giving me the actual test / mocha output. I will see if I can compare the dependency versions from there to the newest generator's dependencies, see if I can find any common links...

baksale commented 4 years ago

same issue on latest generator.

Update: If I change package.json dependencies to

  "dependencies": {
    "@oclif/command": "^1.8.0",
    "@oclif/config": "^1.17.0",
    "@oclif/plugin-help": "^3.2.0",
    "@oclif/errors": "^1",
    "@salesforce/command": "2.1.0",
    "@salesforce/core": "2.1.4",
    "tslib": "^1.13.0"
  },
  "devDependencies": {
    "@salesforce/dev-config": "^1",
    "@oclif/dev-cli": "^1.22.2",
    "@oclif/test": "^1.2.6",
    "@types/chai": "^4.2.12",
    "@types/mocha": "^5.2.7",
    "@types/node": "^10.17.28",
    "chai": "^4.2.0",
    "globby": "^10.0.2",
    "mocha": "^5.2.0",
    "nyc": "^14.1.1",
    "rimraf": "^3.0.2",
    "ts-node": "^8.10.2",
    "typescript": "^3.6.4"
  },
  "engines": {
    "node": ">=8.0.0"
  },

It does work.

But had to also change tsconfig.json to have '"strictNullChecks": false' in it.