From 5350e1bcc37f501b6a0a8ad6f3f283c98a5516b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giancarlo=20Calder=C3=B3n=20C=C3=A1rdenas?= Date: Sat, 21 Sep 2024 00:12:49 -0500 Subject: [PATCH] fix: complete testResults information - Add support for nested suites - Fix TestResultError(s) information - Fix TestSuiteResult(s) information - Fix TestResult(s) information - Update spec file: add new tests - Add Reporters to improve debugging --- src/index.spec.ts | 19 +++++ src/index.ts | 154 ++++++++++++++++++++++++++++++------- web-test-runner.config.mjs | 5 ++ 3 files changed, 152 insertions(+), 26 deletions(-) diff --git a/src/index.spec.ts b/src/index.spec.ts index 25b86f1..4b38c19 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -13,4 +13,23 @@ describe('a test suite', () => { it('should create element', () => { expect(element.innerHTML).toBe('hello there'); }); + + describe('an inner test suite', () => { + it("should always be true: Level 2", () => { + expect(true).toBeTrue(); + expect(undefined).toBeUndefined(); + expect(null).toBeNull(); + expect(["foo", "bar"]).toHaveSize(2); + expect({ "foo": "bar" }).toEqual({ "foo": "bar" }); + }); + describe('another inner test suite', () => { + it("should always be true: level 3", () => { + expect(true).toBeTrue(); + expect(undefined).toBeUndefined(); + expect(null).toBeNull(); + expect(["foo", "bar"]).toHaveSize(2); + expect({ "foo": "bar" }).toEqual({ "foo": "bar" }); + }); + }); + }); }); diff --git a/src/index.ts b/src/index.ts index 18abbd3..f7350df 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,7 @@ export const jasmineTestRunnerConfig = () => { reporters: [ defaultReporter({ reportTestResults: true, reportTestProgress: true }) ], - testRunnerHtml: (_path: any, config: { testFramework: { config?: JasmineConfig }}) => { + testRunnerHtml: (_path: any, config: { testFramework: { config?: JasmineConfig } }) => { const testFramework = { path: './node_modules/jasmine-core/lib/jasmine-core/jasmine.js', config: { @@ -35,7 +35,7 @@ export const jasmineTestRunnerConfig = () => {