jasmine-spec-reporter icon indicating copy to clipboard operation
jasmine-spec-reporter copied to clipboard

Feature: using with jasmine --reporter command line switch

Open apla opened this issue 5 years ago • 3 comments

  • [x] I have this issue with the latest release of jasmine-spec-reporter - 4.2.1
  • [x] I have this issue with the latest release of jasmine 3.3.1
  • [x] I can reproduce this issue with one of the examples

Current behavior

jasmine allows to use reporter as a command line option, like jasmine --reporter=jasmine-spec-reporter, but jasmine-spec-reporter itself is not compatible.

failed to register reporter "jasmine-spec-reporter"
Report is not a constructor
TypeError: Report is not a constructor
    at runJasmine (xxx/node_modules/jasmine/lib/command.js:148:22)
    at Command.run (xxx/node_modules/jasmine/lib/command.js:56:9)
    at Object.<anonymous> (xxx/node_modules/jasmine/bin/jasmine.js:11:9)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)

Also I tried jasmine --reporter=jasmine-spec-reporter/built/spec-reporter.js. In this case, no error reported, but also reporter not works.

apla avatar Mar 14 '19 15:03 apla

This feature seems handy but it can only be used with the default configuration of jasmine-spec-reporter. This feature expect that the reporter module export a constructor (https://github.com/jasmine/jasmine/issues/1027#issuecomment-360873492) but currently jasmine-spec-reporter export:

A way to do that without breaking the current exports could be to have a dedicated node module with only the constructor exported. IMO, it sounds a bit complicated for the benefit of this feature.

Any thoughts?

bcaudan avatar Apr 21 '19 09:04 bcaudan

Would love to get this working! <3

kuebk avatar Mar 23 '20 22:03 kuebk

I have submitted a PR to jasmine-npm, https://github.com/jasmine/jasmine-npm/pull/159.

bcaudan avatar Mar 24 '20 12:03 bcaudan