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

Cannot read property 'origin' of undefined (NativeScript) #262

Closed
vdbongard opened this issue Feb 7, 2020 · 1 comment · Fixed by #263
Closed

Cannot read property 'origin' of undefined (NativeScript) #262

vdbongard opened this issue Feb 7, 2020 · 1 comment · Fixed by #263
Labels

Comments

@vdbongard
Copy link

Steps to reproduce

  1. Set up NativeScript
  2. tns create project-name
  3. Select Angular
  4. Select Hello World
  5. tns test init
  6. Select jasmine
  7. Make a test fail -> change /src/tests/example.ts to:
// A sample Jasmine test
describe("A suite", function() {
  it("contains spec with an expectation", function() {
    expect(true).toBe(false);
  });
});
  1. tns test android

Expected behaviour

NativeScript / 29 (10; ONEPLUS A6003): Executed 0 of 1 SUCCESS (0 secs / 0 secs)
NativeScript / 29 (10; ONEPLUS A6003) A suite contains spec with an expectation FAILED
	Error: Expected true to be false.
	    at <Jasmine>
NativeScript / 29 (10; ONEPLUS A6003): Executed 1 of 1 (1 FAILED) (0.061 secs / 0.005 secs)

Output with karma-jasmine@2.0.1

Actual behaviour

NativeScript / 29 (10; ONEPLUS A6003): Executed 0 of 1 SUCCESS (0 secs / 0 secs)
JS: NSUTR: this.error: An error was thrown in afterAll
JS: TypeError: Cannot read property 'origin' of undefined
JS:     at <Jasmine>
NativeScript / 29 (10; ONEPLUS A6003)  undefined at line undefined FAILED
	An error was thrown in afterAll
	TypeError: Cannot read property 'origin' of undefined
	    at <Jasmine>
NativeScript / 29 (10; ONEPLUS A6003): Executed 1 of 1 (1 FAILED) (0 secs / 0 secs)

Output with karma-jasmine@3.1.0

Probable error source in adapter.js at line 106:

function debugUrl (description) {
  // A link to re-run just one failed test case.
  return window.location.origin + '/debug.html?spec=' + encodeURIComponent(description)
}
johnjbarton added a commit to johnjbarton/karma-jasmine that referenced this issue Feb 8, 2020
Surprise: someone uses karma-jasmine with native=script.
Fixes karma-runner#262
johnjbarton added a commit to johnjbarton/karma-jasmine that referenced this issue Feb 10, 2020
Surprise: someone uses karma-jasmine with native=script.
Fixes karma-runner#262
johnjbarton added a commit that referenced this issue Feb 11, 2020
Surprise: someone uses karma-jasmine with native=script.
Fixes #262
karmarunnerbot pushed a commit that referenced this issue Feb 11, 2020
## [3.1.1](v3.1.0...v3.1.1) (2020-02-11)

### Bug Fixes

* **adapter:** do not emit debug url unless in a browser ([#263](#263)) ([9bcce88](9bcce88)), closes [#262](#262)
@karmarunnerbot
Copy link
Member

🎉 This issue has been resolved in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment