The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/apps-engine/tests/server/managers/AppApi.spec.ts

28 lines
783 B

import { Expect, SetupFixture, Test } from 'alsatian';
import type { IApi } from '../../../src/definition/api';
import type { IApiEndpoint } from '../../../src/definition/api/IApiEndpoint';
import type { ProxiedApp } from '../../../src/server/ProxiedApp';
import { AppApi } from '../../../src/server/managers/AppApi';
export class AppApiRegistrationTestFixture {
private mockApp: ProxiedApp;
@SetupFixture
public setupFixture() {
this.mockApp = {
getID() {
return 'id';
},
} as ProxiedApp;
}
@Test()
public ensureAppApi() {
Expect(() => new AppApi(this.mockApp, {} as IApi, {} as IApiEndpoint)).not.toThrow();
const ascr = new AppApi(this.mockApp, {} as IApi, {} as IApiEndpoint);
Expect(ascr.app).toBeDefined();
Expect(ascr.api).toBeDefined();
}
}