diff --git a/lib/js-api/test/auth.spec.ts b/lib/js-api/test/auth.spec.ts index 52c575756c..5c2c3f0740 100644 --- a/lib/js-api/test/auth.spec.ts +++ b/lib/js-api/test/auth.spec.ts @@ -64,13 +64,11 @@ describe('Auth', () => { assert.equal(data, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); }); - it('should return an error if wrong credential are used 403 the login fails', (done) => { + it('should return an error if wrong credential are used 403 the login fails', async () => { authResponseEcmMock.get403Response(); - alfrescoJsApi.login('wrong', 'name').then(NOOP, (error: ErrorResponse) => { - assert.equal(error.status, 403); - done(); - }); + const error = await alfrescoJsApi.login('wrong', 'name'); + assert.equal(error.status, 403); }); }); diff --git a/package-lock.json b/package-lock.json index 59c70b5194..2bd9345a7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,6 +87,7 @@ "@types/event-emitter": "^0.3.3", "@types/jasmine": "4.0.3", "@types/jasminewd2": "~2.0.2", + "@types/jest": "^29.5.14", "@types/jsdom": "^21.1.5", "@types/minimatch": "^3.0.3", "@types/mocha": "^10.0.6", @@ -17394,6 +17395,48 @@ "@types/jasmine": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jest/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@types/jest/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@types/jest/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, "node_modules/@types/jsdom": { "version": "21.1.7", "dev": true, diff --git a/package.json b/package.json index 7760268fe4..8e26b606f1 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "@types/event-emitter": "^0.3.3", "@types/jasmine": "4.0.3", "@types/jasminewd2": "~2.0.2", + "@types/jest": "^29.5.14", "@types/jsdom": "^21.1.5", "@types/minimatch": "^3.0.3", "@types/mocha": "^10.0.6",