Can someone point me in the right direction of how to get this working under VS 2019 using the context menu test runner?
I have a .NET Core 3.0 MVC app and am trying to test some javascript compiled from typescript (MSBuild which compiles on save) - Jasmine nuget pacakage 2.6.4.
Using the context menu to 'Open in Browser' on the app.spec.js file passes tests.
Selecting 'Run JS Tests' however returns an 'Cannot find variable: 'Format'.
app.spec.js:
/// <reference path="../compiled/site.js" />
describe("Format Tests", function () {
it("Can format a variable in a message", function () {
var message = "Request failed: {0}";
var replacement = "Reason";
var result = "Request failed: Reason";
expect(Format(message, [replacement])).toBe(result);
});
it("Does not replace without placeholder", function () {
var message = "Request failed:";
var replacement = "Reason";
var result = "Request failed:";
expect(Format(message, [replacement])).toBe(result);
});
});
ReferenceError: Can't find variable: Format in file:///C:/Users/test/source/repos/CCBCForms/src/CCBCForms/scripts/tests/app.spec.js (line 8)
attempt@file:///c:/users/test/appdata/local/microsoft/visualstudio/16.0_0b2fdc68/extensions/ubcahz0h.iup/ChutzpahTestHarnessFiles/jasmine/v2/jasmine.js:4478:50
run@file:///c:/users/test/appdata/local/microsoft/visualstudio/16.0_0b2fdc68/extensions/ubcahz0h.iup/ChutzpahTestHarnessFiles/jasmine/v2/jasmine.js:4402:27
execute@file:///c:/users/test/appdata/local/microsoft/visualstudio/16.0_0b2fdc68/extensions/ubcahz0h.iup/ChutzpahTestHarnessFiles/jasmine/v2/jasmine.js:4384:13
queueRunnerFactory@file:///c:/users/test/appdata/local/microsoft/visualstudio/16.0_0b2fdc68/extensions/ubcahz0h.iup/ChutzpahTestHarnessFiles/jasmine/v2/jasmine.js:964:42
execute@file:///c:/users/test/appdata/local/microsoft/visualstudio/16.0_0b2fdc68/extensions/ubcahz0h.iup/ChutzpahTestHarnessFiles/jasmine/v2/jasmine.js:563:28
I'm stuck as to why the app.spec.js file doesn't seem to be picking up that compiled file that is referenced both using the <reference path> and the References section within the chutzpah config file.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Can someone point me in the right direction of how to get this working under VS 2019 using the context menu test runner?
I have a .NET Core 3.0 MVC app and am trying to test some javascript compiled from typescript (MSBuild which compiles on save) - Jasmine nuget pacakage 2.6.4.
chutzpah.json (in the project root):
Project structure:
Using the context menu to 'Open in Browser' on the
app.spec.js
file passes tests. Selecting 'Run JS Tests' however returns an 'Cannot find variable: 'Format'.app.spec.js:
compiled/site.js (extract)
Stack trace in VS output:
I'm stuck as to why the
app.spec.js
file doesn't seem to be picking up that compiled file that is referenced both using the<reference path>
and theReferences
section within the chutzpah config file.Can anyone shed any light?