my-chat-room/apps/api/src/app/app.service.spec.ts

22 lines
495 B
TypeScript

import { Test } from '@nestjs/testing';
import { AppService } from './app.service';
describe('AppService', () => {
let service: AppService;
beforeAll(async () => {
const app = await Test.createTestingModule({
providers: [AppService],
}).compile();
service = app.get<AppService>(AppService);
});
describe('getData', () => {
it('should return "Welcome to api!"', () => {
expect(service.getData()).toEqual({ message: 'Welcome to api!' });
});
});
});