diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json index 67d7e6a2e9..ba6bd29615 100644 --- a/e2e/tsconfig.e2e.json +++ b/e2e/tsconfig.e2e.json @@ -6,8 +6,7 @@ "target": "es5", "types": [ "jasmine", - "jasminewd2", "node" ] } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 38447a3b4c..f30eae5daf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/ccd-case-ui-toolkit", - "version": "7.3.54", + "version": "7.3.54-exui-1855-rc-1", "engines": { "node": ">=20.19.0" }, @@ -104,8 +104,7 @@ "@storybook/manager-webpack4": "^6.5.10", "@storybook/preset-scss": "^1.0.3", "@storybook/testing-library": "^0.2.0", - "@types/jasmine": "~2.8.0", - "@types/jasminewd2": "^2.0.3", + "@types/jasmine": "~5.1.0", "@types/node": "^20.19.0", "@types/pegjs": "^0.10.0", "@types/underscore": "^1.11.4", diff --git a/projects/ccd-case-ui-toolkit/package.json b/projects/ccd-case-ui-toolkit/package.json index 6fdf4141f8..c64a26e80d 100644 --- a/projects/ccd-case-ui-toolkit/package.json +++ b/projects/ccd-case-ui-toolkit/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/ccd-case-ui-toolkit", - "version": "7.3.54", + "version": "7.3.54-exui-1855-rc-1", "engines": { "node": ">=20.19.0" }, diff --git a/projects/ccd-case-ui-toolkit/src/jasmine-compat.d.ts b/projects/ccd-case-ui-toolkit/src/jasmine-compat.d.ts new file mode 100644 index 0000000000..191e2cf71d --- /dev/null +++ b/projects/ccd-case-ui-toolkit/src/jasmine-compat.d.ts @@ -0,0 +1,28 @@ +// Keeps the existing test suite compatible with newer, stricter Jasmine typings. +declare function spyOn(object: T, method: string): jasmine.Spy; + +declare namespace jasmine { + interface SpyAnd { + returnValue(val: any): Spy; + returnValues(...values: any[]): Spy; + callFake(fn: Func): Spy; + } + + interface FunctionMatchers { + toHaveBeenCalledWith(...params: any[]): void; + toHaveBeenCalledOnceWith(...params: any[]): void; + } + + interface Matchers { + toBe(expected: any, expectationFailOutput?: any): void; + toEqual(expected: any, expectationFailOutput?: any): void; + } + + interface Calls { + argsFor(index: number): any[]; + allArgs(): ReadonlyArray; + all(): ReadonlyArray>; + mostRecent(): CallInfo; + first(): CallInfo; + } +} diff --git a/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.spec.ts b/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.spec.ts index fc13a5fcff..5c2d615378 100644 --- a/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.spec.ts +++ b/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.spec.ts @@ -70,9 +70,7 @@ describe('QueryWriteDateInputComponent', () => { describe('updateDate', () => { it('should invoke onChange and onTouched when updateDate is called with a valid date input', () => { - // @ts-expect-error - private method const onChangeSpy = spyOn(component, 'onChange'); - // @ts-expect-error - private method const onTouchedSpy = spyOn(component, 'onTouched'); component.day = 7; component.month = 6; @@ -85,9 +83,7 @@ describe('QueryWriteDateInputComponent', () => { }); it('should invoke onChange with null when updateDate is called with an invalid date input', () => { - // @ts-expect-error - private method const onChangeSpy = spyOn(component, 'onChange'); - // @ts-expect-error - private method const onTouchedSpy = spyOn(component, 'onTouched'); component.day = 35; component.month = 15; diff --git a/projects/ccd-case-ui-toolkit/src/lib/shared/services/http/http.service.spec.ts b/projects/ccd-case-ui-toolkit/src/lib/shared/services/http/http.service.spec.ts index 2a8c3ea2de..8459884264 100644 --- a/projects/ccd-case-ui-toolkit/src/lib/shared/services/http/http.service.spec.ts +++ b/projects/ccd-case-ui-toolkit/src/lib/shared/services/http/http.service.spec.ts @@ -114,7 +114,7 @@ describe('HttpService', () => { httpService.get(URL, options); - const headers = httpMock.get.calls.mostRecent().args[1].headers; + const headers = httpMock.get.calls.mostRecent().args[1].headers as HttpHeaders; expect(headers.get('Content-Type')).toEqual(CONTENT_TYPE_HEADER_VALUE); expect(headers.get('Accept')).toEqual(ACCEPT_HEADER_VALUE); })); @@ -140,7 +140,7 @@ describe('HttpService', () => { httpService.get(URL, options); - const headers = httpMock.get.calls.mostRecent().args[1].headers; + const headers = httpMock.get.calls.mostRecent().args[1].headers as HttpHeaders; expect(headers.get('Content-Type')).toEqual('application/json'); expect(headers.get('Accept')).toEqual('application/json'); })); @@ -220,7 +220,7 @@ describe('HttpService', () => { httpService.post(URL, BODY, options); - const headers = httpMock.post.calls.mostRecent().args[2].headers; + const headers = httpMock.post.calls.mostRecent().args[2].headers as HttpHeaders; expect(headers.get('Content-Type')).toEqual('application/json'); expect(headers.get('Accept')).toEqual('application/json'); })); @@ -284,7 +284,7 @@ describe('HttpService', () => { httpService.put(URL, BODY, options); - const headers = httpMock.put.calls.mostRecent().args[2].headers; + const headers = httpMock.put.calls.mostRecent().args[2].headers as HttpHeaders; expect(headers.get('Content-Type')).toEqual('application/json'); expect(headers.get('Accept')).toEqual('application/json'); })); @@ -348,7 +348,7 @@ describe('HttpService', () => { httpService.delete(URL, options); - const headers = httpMock.delete.calls.mostRecent().args[1].headers; + const headers = httpMock.delete.calls.mostRecent().args[1].headers as HttpHeaders; expect(headers.get('Content-Type')).toEqual('application/json'); expect(headers.get('Accept')).toEqual('application/json'); })); diff --git a/yarn.lock b/yarn.lock index dcefd6d975..9987f522fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3425,8 +3425,7 @@ __metadata: "@storybook/manager-webpack4": "npm:^6.5.10" "@storybook/preset-scss": "npm:^1.0.3" "@storybook/testing-library": "npm:^0.2.0" - "@types/jasmine": "npm:~2.8.0" - "@types/jasminewd2": "npm:^2.0.3" + "@types/jasmine": "npm:~5.1.0" "@types/node": "npm:^20.19.0" "@types/pegjs": "npm:^0.10.0" "@types/underscore": "npm:^1.11.4" @@ -8036,26 +8035,10 @@ __metadata: languageName: node linkType: hard -"@types/jasmine@npm:*": - version: 5.1.13 - resolution: "@types/jasmine@npm:5.1.13" - checksum: 10/f873c5650202b339866244a1c019fecc7abe47694cf8899ef17e965aae51b57cd777bb7ab813a61c4482cbc436eb0c18f02ff8def320999e403a56bd5a80d21e - languageName: node - linkType: hard - -"@types/jasmine@npm:~2.8.0": - version: 2.8.23 - resolution: "@types/jasmine@npm:2.8.23" - checksum: 10/01d2c2ed4d651147ebc6ff690a5795f6a33d007f5965cfb7f76bda104f9cc900ecebbd26046cf59a994a1e6ba32feafe5625777504e600616f99ffb2ec12f48c - languageName: node - linkType: hard - -"@types/jasminewd2@npm:^2.0.3": - version: 2.0.13 - resolution: "@types/jasminewd2@npm:2.0.13" - dependencies: - "@types/jasmine": "npm:*" - checksum: 10/a661e1add2d7c0582b05e79fcdbc0297fa4292b38b1273e2970d88d0775c85ecc322e1417c84826b5e6caeceab4dc267f5f00300c0c11d0fc459601057698700 +"@types/jasmine@npm:~5.1.0": + version: 5.1.15 + resolution: "@types/jasmine@npm:5.1.15" + checksum: 10/e86a962c153ff91ffe3c65a633578a5e3f6e065e58268c00e839b03dac6792b1e0a2afca216ccfa1e31647e49ef1a935332242350dca91a2940ad883643abd04 languageName: node linkType: hard