reorganized tests; implemented api e2e test

main
Inga 🏳‍🌈 11 months ago
parent f647b8e7fb
commit 4449769a97
  1. 10
      test/app.e2e-spec.ts
  2. 2
      test/jest-e2e.json
  3. 2
      test/omdbApiClient.e2e-spec.ts
  4. 2
      test/omdbProvider.e2e-spec.ts

@ -15,10 +15,14 @@ describe('AppController (e2e)', () => {
await app.init();
});
it('/ (GET)', () => {
it('/api/movies/tt0061852 (GET)', () => {
return request(app.getHttpServer())
.get('/')
.get('/api/movies/tt0061852')
.expect(200)
.expect('Hello World!');
.expect((response) => {
expect(response.body).toMatchObject({
title: 'The Jungle Book',
});
});
});
});

@ -2,7 +2,7 @@
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": ".",
"testEnvironment": "node",
"testRegex": ".e2e-spec.ts$",
"testRegex": "\\.e2e-spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
}

@ -1,6 +1,6 @@
import { describe, it, expect } from '@jest/globals';
import { createOmdbApiClient } from './apiClient';
import { createOmdbApiClient } from '../src/integration/movies/omdb/apiClient';
describe('createOmdbApiClient', () => {
const client = createOmdbApiClient('68fd98ab');

@ -1,6 +1,6 @@
import { describe, it, expect } from '@jest/globals';
import { createOmdbProviderByApiKey } from './index';
import { createOmdbProviderByApiKey } from '../src/integration/movies/omdb';
describe('createOmdbProvider', () => {
const client = createOmdbProviderByApiKey('68fd98ab');
Loading…
Cancel
Save