Skip to content

Commit

Permalink
chore: test framework now reports jasmine error outside of test runs …
Browse files Browse the repository at this point in the history
…in console
  • Loading branch information
abose committed Oct 6, 2023
1 parent 2d853c5 commit 110ea3f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/UnitTestReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ define(function (require, exports, module) {
if(self.totalFailedCount === 0){
testRunnerLogToConsole(`\u2714 All(${self.totalSpecCount}) tests passed.`);
if(result.overallStatus !== 'passed') {
window.externalJasmineFailures = true;
testRunnerErrorToConsole(`\u2716 Some suites was detected to have failures outside of the suite tests. This could indicate an underlying problem. please run tests locally to debug.`);
for(const element of result.failedExpectations) {
if(element.stack){
Expand Down
5 changes: 5 additions & 0 deletions tests-playwright/integration/integration-test-suite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ async function execTests(page, url) {
return Promise.resolve(window.testResults);
});
expect(result.errors).toStrictEqual({});

const externalJasmineFailures = await page.evaluate(() => {
return Promise.resolve(window.externalJasmineFailures);
});
expect(externalJasmineFailures).toEqual(undefined);
}

test("Execute integration tests", async ({ page }) => {
Expand Down
5 changes: 5 additions & 0 deletions tests-playwright/unit/unit-test-suite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ test("Execute all unit tests", async ({ page }) => {
return Promise.resolve(window.testResults);
});
expect(result.errors).toStrictEqual({});

const externalJasmineFailures = await page.evaluate(() => {
return Promise.resolve(window.externalJasmineFailures);
});
expect(externalJasmineFailures).toEqual(undefined);
});

0 comments on commit 110ea3f

Please sign in to comment.