/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
integration/graphql-code-first/e2e/code-first.spec.ts
36 строк
825 B
Tony133
test(integration): rename app module in test e2e
24 май 2022, 22:28
24 май 2022, 22:28
c9e619e
Код
Авторство
О чём код?
import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import * as request from 'supertest'; import { AppModule } from '../src/app.module'; describe('GraphQL - Code-first', () => { let app: INestApplication; beforeEach(async () => { const module = await Test.createTestingModule({ imports: [AppModule], }).compile(); app = module.createNestApplication(); await app.init(); }); it(`should return query result`, () => { return request(app.getHttpServer()) .post('/graphql') .send({ operationName: null, variables: {}, query: '{\n recipes {\n id\n }\n}\n', }) .expect(200, { data: { recipes: [], }, }); }); afterEach(async () => { await app.close(); }); });