“No spec found” is displayed after I use one jasmine reporter

社会主义新天地 提交于 2019-12-13 03:13:57

问题


I am using jasmine-node framework for my API automation. I am able to run REST services and able to get the result using node-fetch or http. Without reporter when I run with the below command I was able to get the results in console

jasmine spec/xxx.spec.js

After that I added a reporter(pretty html reporter) for reporting. Now when I run those commands, I get the below error.

No specs found

Below are my code for reporter.js

var Jasmine = require('jasmine');
var HtmlReporter = require('jasmine-pretty-html-reporter').Reporter;
var path=require('path');
var jasmine = new Jasmine();

jasmine.loadConfigFile('./spec/support/jasmine.json');

// options object
jasmine.addReporter(new HtmlReporter({
  path: path.join('./spec/helpers','results')
}));

jasmine.execute();

and jasmine.json is below

{
  "spec_dir": "spec",
  "spec_files": [
    "**/*[sS]pec.js"
  ],
  "helpers": [
    "helpers/**/*.js"
  ],
  "stopSpecOnExpectationFailure": false,
  "random": true
}

Please help me with this. Also please let me know if there is any better reporter than this.Thanks in advance

来源:https://stackoverflow.com/questions/51834238/no-spec-found-is-displayed-after-i-use-one-jasmine-reporter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!