UNPKG

@dxdeveloperexperience/hygie

Version:

Hygie is an easy-to-use Open-Source REST API allowing you to interact with GIT events. This NestJS API expose a set of customizable rules to automate your project's life cycle.

38 lines (30 loc) 945 B
import * as request from 'supertest'; import { Test } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; import { RemoteConfigUtils } from './utils'; import { MockAppModule } from '../__mocks__/mock.app.module'; describe('getAppRules (e2e)', () => { let app: INestApplication; beforeAll(async () => { const moduleFixture = await Test.createTestingModule({ imports: [MockAppModule], }).compile(); app = moduleFixture.createNestApplication(); await app.init(); }); it('/register/config-env (POST)', () => { RemoteConfigUtils.registerConfigEnv = jest.fn(); process.env.ENCRYPTION_KEY = 'somekey'; return request(app.getHttpServer()) .post('/register/config-env') .send({ gitApi: 'body.gitApi', gitToken: 'body.gitToken', gitRepo: 'body.gitRepo', }) .expect(200); }); afterAll(async () => { await app.close(); }); });