migrate js-api tests from Jest to Node.js native test runner (#12104)

This commit is contained in:
Denys Vuika
2026-07-28 20:04:31 +01:00
committed by GitHub
parent c316c6b594
commit 6c8b874704
58 changed files with 2355 additions and 4978 deletions
+8 -2
View File
@@ -16,12 +16,14 @@
*/
import assert from 'assert';
import { resetGlobalMockAgent } from './mockObjects/base.mock';
import { AlfrescoApi, AlfrescoApiClient, DateAlfresco } from '../src';
import { EcmAuthMock } from './mockObjects';
import { describe, it, beforeEach, afterEach } from 'node:test';
describe('Alfresco Core API Client', () => {
describe('type conversion', () => {
it('should return the username after login', (done) => {
it('should return the username after login', async () => {
const authResponseEcmMock = new EcmAuthMock('https://127.0.0.1:8080');
authResponseEcmMock.get201Response();
@@ -32,7 +34,7 @@ describe('Alfresco Core API Client', () => {
alfrescoJsApi.login('admin', 'admin').then(() => {
assert.equal(alfrescoJsApi.getEcmUsername(), 'admin');
done();
});
});
});
@@ -97,6 +99,10 @@ describe('Alfresco Core API Client', () => {
alfrescoApiClient.config = { ticketEcm: mockConfigTicket };
});
afterEach(() => {
resetGlobalMockAgent();
});
it('should return the supplied ticket', () => {
const ticket = alfrescoApiClient.getAlfTicket(mockArgTicket);
const expectedResult = alfTicketParam + mockArgTicket;