Download src/bin/app.controller.spec.ts from ydm1904/lab: direct link, hf CLI and curl.
- Browser
- Download file 695 Bytes
-
https://huggingface.co/spaces/ydm1904/lab/resolve/main/src/bin/app.controller.spec.ts
- Command line
-
hf download hf://spaces/ydm1904/lab/src/bin/app.controller.spec.ts
-
curl -L -o app.controller.spec.ts https://huggingface.co/spaces/ydm1904/lab/resolve/main/src/bin/app.controller.spec.ts
695 Bytes
| import { Test, TestingModule } from '@nestjs/testing'; | |
| import { AppController } from './app.controller'; | |
| import { AppService } from './app.service'; | |
| describe('AppController', () => { | |
| let appController: AppController; | |
| beforeEach(async () => { | |
| const app: TestingModule = await Test.createTestingModule({ | |
| controllers: [AppController], | |
| providers: [AppService], | |
| }).compile(); | |
| appController = app.get<AppController>(AppController); | |
| }); | |
| describe('root', () => { | |
| it('should return "Hello World!"', () => { | |
| const versionSpy = jest.spyOn(appController, 'version'); | |
| appController.version(); | |
| expect(versionSpy).toHaveBeenCalled(); | |
| }); | |
| }); | |
| }); | |