karma
karma copied to clipboard
'base' and 'absolute' being replaced in reporter output
Despite the commit in v0.13.11 (b3798df) addressing this, this issue still persists in v0.13.15 .
Could you provide a repro please?
I'm seeing this too. I'm using karma-spec-reporter
, running this test:
describe('words being replaced', function () {
it('formats base and absolute unexpectedly in the expectation output only', function () {
expect('base').toEqual('absolute');
});
});
The output I'm getting is:
1) formats base and absolute unexpectedly in the expectation output only
words being replaced
Expected '/home/michael/proj' to equal ''
At /home/michael/proj/spec/specExample.js:7
Perhaps https://github.com/karma-runner/karma/blob/master/lib/reporter.js#L25 needs to be more restrictive?
More Info: Suppose I have an expectation written as such:
var result = subject.requestAsJson();
expect(result).toEqual('{ "databaseType": "fredbob" }');
I get output in the console that looks like this:
Expected '{"dataC:/Users/Me/src/ProjectType":"fredbob" }'
to equal '{ dataC:/Users/Me/src/ProjectType": "foobar" }'.
I'm using jasmine in the context of gulp -> karma -> require -> jasmine
.
This problem still exists guys! Is there a plan and timeline to get a fix out? Hinders testing with firebase!
👍
Got this today, it's quite funny but should be fix! :smile:
Just experienced it too. The problem is the same as mentioned above :)
It seems like URL_REGEXP from https://github.com/karma-runner/karma/blob/master/lib/reporter.js#L22
matches strings like foo absolute bar
still alive and kicking 😢
LOG: 'https://api.example.com/base/path/foo'
Chrome Headless 120.0.6099.216 (Mac OS 10.15.7) [...] FAILED
Expected 'https://api.example.compath/foo' to be 'https://api.example.compath'.
Spec
console.log(fetch.calls.mostRecent().args[0]);
expect(fetch.calls.mostRecent().args[0]).toBe(
'https://api.example.com/base/path'
);