test: create initial unit tests

This commit is contained in:
Julian Tölle 2021-06-20 00:49:17 +02:00
parent be7fb7d13a
commit e476243b85
16 changed files with 1177 additions and 18 deletions

View file

@ -1,18 +1,25 @@
import { HttpService } from "@nestjs/common";
import { Test, TestingModule } from "@nestjs/testing";
import { SpotifyApiService } from "./spotify-api.service";
describe("SpotifyApiService", () => {
let service: SpotifyApiService;
let httpService: HttpService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [SpotifyApiService],
providers: [
SpotifyApiService,
{ provide: HttpService, useFactory: () => ({}) },
],
}).compile();
service = module.get<SpotifyApiService>(SpotifyApiService);
httpService = module.get<HttpService>(HttpService);
});
it("should be defined", () => {
expect(service).toBeDefined();
expect(httpService).toBeDefined();
});
});