taras42 / karma-jasmine-html-reporter

A Karma plugin. Dynamically displays tests results at debug.html page
MIT License
44 stars 17 forks source link

Got jasmineRequire is not defined error in angular #24

Open wpcfan opened 7 years ago

wpcfan commented 7 years ago

Bug Report or Feature Request (mark with an x)

Versions.

npm 4.2.0 node v7.9.0

Repro steps.

ng new testng cd testng ng test

The log given by the failure.

> ng test

01 05 2017 13:38:11.764:WARN [karma]: No captured browser, open http://localhost:9876/
01 05 2017 13:38:11.785:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9876/
01 05 2017 13:38:11.786:INFO [launcher]: Launching browser Chrome with unlimited concurrency
01 05 2017 13:38:11.793:INFO [launcher]: Starting browser Chrome
01 05 2017 13:38:13.856:INFO [Chrome 58.0.3029 (Mac OS X 10.12.4)]: Connected on socket 3wCmVkUlL6e2k7MXAAAA with id 23369500
Chrome 58.0.3029 (Mac OS X 10.12.4) ERROR
  Uncaught ReferenceError: jasmineRequire is not defined
  at node_modules/.0.2.2@karma-jasmine-html-reporter/src/lib/html.jasmine.reporter.js:24

Chrome 58.0.3029 (Mac OS X 10.12.4) ERROR
  Uncaught ReferenceError: jasmineRequire is not defined
  at node_modules/.0.2.2@karma-jasmine-html-reporter/src/lib/html.jasmine.reporter.js:24

Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 0 of 3 SUCCESS (0 secs / 0 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4) ERROR
  Disconnected, because no message in 10000 ms.
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 0 of 3 DISCONNECTED (10.004 secs / 0 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4) ERROR
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 0 of 3 DISCONNECTED (10.004 secs / 0 secs)

Desired functionality.

It should works no errors.

gaving-mx commented 7 years ago

can you make "ng test" work now? i also ran into this issue. here is part of my package.json

  "devDependencies": {
    "@angular/cli": "1.0.0",
    "@ionic/app-scripts": "1.3.7",
    "@types/jasmine": "^2.5.47",
    "@types/node": "^7.0.22",
    "jasmine-core": "^2.6.2",
    "jasmine-spec-reporter": "^4.1.0",
    "karma": "^1.7.0",
    "karma-chrome-launcher": "^2.1.1",
    "karma-cli": "^1.0.1",
    "karma-coverage-istanbul-reporter": "^1.3.0",
    "karma-jasmine": "^1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "typescript": "2.2.1"
  },
wpcfan commented 7 years ago

did you use a third-party npm repo? if so, you can try switch back to official registry. Mine works when switching back.

gejun2008 commented 7 years ago

I have some error, my package.json is as below.


"dependencies": {
    "@angular-redux/store": "6.1.0",
    "@angular/animations": "4.0.1",
    "@angular/common": "4.0.1",
    "@angular/compiler": "4.0.1",
    "@angular/core": "4.0.1",
    "@angular/forms": "4.0.1",
    "@angular/http": "4.0.1",
    "@angular/platform-browser": "4.0.1",
    "@angular/platform-browser-dynamic": "4.0.1",
    "@angular/router": "4.0.1",
    "angular-tree-component": "^3.7.2",
    "bootstrap": "3.3.7",
    "bootstrap-colorpicker": "2.5.1",
    "bootstrap-markdown": "2.10.0",
    "bootstrap-progressbar": "0.9.0",
    "bootstrap-slider": "9.7.2",
    "bootstrap-tagsinput": "0.7.1",
    "bootstrap-timepicker": "0.5.2",
    "chart.js": "2.5.0",
    "clockpicker": "0.0.7",
    "clone": "2.1.1",
    "core-js": "2.4.1",
    "crypto-js": "^3.1.9-1",
    "debounce": "1.0.0",
    "dropzone": "4.3.0",
    "dygraphs": "1.1.1",
    "fuelux": "3.15.12",
    "he": "1.1.1",
    "highcharts": "5.0.10",
    "ion-rangeslider": "2.1.7",
    "jquery": "2.2.4",
    "jquery-color": "1.0.0",
    "jquery-jcrop": "0.9.13",
    "jquery-knob": "1.2.11",
    "jquery-ui-npm": "1.12.0",
    "jquery-validation": "1.16.0",
    "jquery.maskedinput": "1.4.1",
    "lodash": "^4.17.4",
    "markdown": "0.5.0",
    "morris.js": "0.5.0",
    "ng2-bootstrap": "1.6.2",
    "ngx-popover": "0.0.16",
    "nouislider": "9.2.0",
    "raphael": "2.2.7",
    "redux": "3.6.0",
    "rxjs": "5.3.0",
    "scriptjs": "2.5.8",
    "select2": "4.0.3",
    "smartadmin-plugins": "1.0.15",
    "summernote": "0.8.3",
    "to-markdown": "3.0.4",
    "ts-helpers": "1.1.2",
    "zone.js": "0.8.5"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0",
    "@angular/compiler-cli": "4.0.1",
    "@types/jasmine": "2.5.47",
    "@types/jquery": "2.0.41",
    "@types/lodash": "^4.14.73",
    "@types/node": "7.0.12",
    "codelyzer": "2.1.1",
    "css-loader": "0.28.0",
    "exports-loader": "0.6.4",
    "expose-loader": "0.7.3",
    "file-loader": "0.11.1",
    "imports-loader": "0.7.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.6.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.0.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "karma-remap-istanbul": "0.6.0",
    "protractor": "5.1.1",
    "raw-loader": "0.5.1",
    "script-loader": "0.7.0",
    "style-loader": "0.16.1",
    "ts-node": "3.0.2",
    "tslint": "5.0.0",
    "typescript": "2.2.2",
    "url-loader": "0.5.8"
  },