-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add e2e testing when pushing * feat: add health check * fix: test command * fix: update attempts for health check * feat: show log when failure * fix: test * feat: update version * docs(readme): update usage
- Loading branch information
Showing
12 changed files
with
142 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import { INestApplication } from '@nestjs/common' | ||
import { Test, TestingModule } from '@nestjs/testing' | ||
import * as request from 'supertest' | ||
|
||
import { AppModule } from './../src/app.module' | ||
|
||
describe('AppController (e2e)', () => { | ||
let app: INestApplication | ||
|
||
beforeEach(async () => { | ||
const moduleFixture: TestingModule = await Test.createTestingModule({ | ||
imports: [AppModule], | ||
}).compile() | ||
|
||
app = moduleFixture.createNestApplication() | ||
await app.init() | ||
}) | ||
const apiURL = process.env.API_URL | ||
|
||
it('/healthz (GET)', () => { | ||
return request(app.getHttpServer()).get('/healthz').expect(200) | ||
it('/v1/healthz (GET)', () => { | ||
return request(apiURL).get('/v1/healthz').expect(200) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as request from 'supertest' | ||
|
||
describe('Auth (e2e)', () => { | ||
const { API_URL, USER_EMAIL, USER_PASSWORD } = process.env | ||
|
||
it('register', () => { | ||
return request(API_URL) | ||
.post('/v1/auth/register') | ||
.send({ | ||
email: USER_EMAIL, | ||
password: USER_PASSWORD, | ||
}) | ||
.expect(201) | ||
}) | ||
|
||
it('login', () => { | ||
return request(API_URL) | ||
.post('/v1/auth/login') | ||
.send({ | ||
email: USER_EMAIL, | ||
password: USER_PASSWORD, | ||
}) | ||
.expect(200) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { pathsToModuleNameMapper } = require('ts-jest') | ||
const { compilerOptions } = require('../tsconfig.json') | ||
|
||
module.exports = { | ||
moduleFileExtensions: ['js', 'json', 'ts'], | ||
rootDir: '.', | ||
testEnvironment: 'node', | ||
testRegex: '.e2e-spec.ts$', | ||
transform: { | ||
'^.+\\.(t|j)s$': 'ts-jest', | ||
}, | ||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/..' }), | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters