Skip to content

Bad URL in stacktrace if urlRoot specified #2897

@segrey

Description

@segrey

Expected behaviour

Correct URL is printed in stacktrace

Actual behaviour

Bad URL is printed in stacktrace

Environment Details

// package.json
{
  "devDependencies": {
    "karma": "^1.7.1",
    "karma-chrome-launcher": "^2.2.0",
    "karma-jasmine": "^1.1.0",
    "jasmine-core": "^2.8.0"
  }
}
//karma.conf.js
module.exports = function (config) {
  config.set({
    urlRoot: '/__karma__',
    frameworks: ['jasmine'],
    files: ['tests/**/*.js'],
    reporters: ['progress'],
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false
  });
};
// tests/sub/foo.js
describe('foo', function () {
    it('test', function () {
        fail();
    });
});

Steps to reproduce the behaviour

  1. Run tests with ./node_modules/karma/bin/karma start
  2. Output:
9 11 2017 19:49:40.487:WARN [config]: urlRoot normalized to "/__karma__/"
29 11 2017 19:49:40.540:WARN [karma]: No captured browser, open http://localhost:9876/__karma__/
29 11 2017 19:49:40.546:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/__karma__/
29 11 2017 19:49:40.546:INFO [launcher]: Launching browser Chrome with unlimited concurrency
29 11 2017 19:49:40.560:INFO [launcher]: Starting browser Chrome
29 11 2017 19:49:40.980:INFO [Chrome 62.0.3202 (Linux 0.0.0)]: Connected on socket 3ny3gbgd6AeYqWRDAAAA with id 79121705
Chrome 62.0.3202 (Linux 0.0.0) foo test FAILED
        Failed
            at UserContext.<anonymous> (http://localhost:9876/__karma__tests/sub/foo.js:3:9)
Chrome 62.0.3202 (Linux 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.003 secs / 0.003 secs)

Unexpected output part:

  at UserContext.<anonymous> (http://localhost:9876/__karma__tests/sub/foo.js:3:9)

Expected:

  at UserContext.<anonymous> (tests/sub/foo.js:3:9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions