-
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.
- Loading branch information
Showing
2 changed files
with
68 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
name: e2e | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
jobs: | ||
e2eTests: | ||
name: e2e-Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install | ||
run: npm install | ||
- name: e2e test | ||
run: npm run test:e2e | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
# name: e2e | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# - development | ||
# jobs: | ||
# e2eTests: | ||
# name: e2e-Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# with: | ||
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
# - name: install | ||
# run: npm install | ||
# - name: e2e test | ||
# run: npm run test:e2e | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
|
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,29 +1,48 @@ | ||
import { INestApplication } from '@nestjs/common'; | ||
import * as request from 'supertest'; | ||
import { expect } from 'chai'; | ||
import { AppModule } from '../../src/app.module'; | ||
import { NestFactory } from '@nestjs/core'; | ||
|
||
jest.useFakeTimers(); | ||
jest.setTimeout(50000); | ||
|
||
describe('AppController (e2e)', () => { | ||
let app: INestApplication; | ||
|
||
beforeEach(async () => { | ||
app = await NestFactory.create(AppModule); | ||
app.init(); | ||
}); | ||
|
||
afterEach(async () => { | ||
await app.close(); | ||
}); | ||
|
||
it('/neighborhoods/city/brasil/sc/orleans (GET)', async () => { | ||
const actual = await request(app.getHttpServer()) | ||
.get('/neighborhoods/city/brasil/sc/orleans') | ||
.expect(200); | ||
|
||
expect(actual.body).to.be.an('array').that.is.not.empty; | ||
}); | ||
}); | ||
// import { INestApplication } from '@nestjs/common'; | ||
// import * as request from 'supertest'; | ||
// import { expect } from 'chai'; | ||
// import { AppModule } from '../../src/app.module'; | ||
// import { Test } from '@nestjs/testing'; | ||
// import { Connection } from 'mongoose'; | ||
// import { getConnectionToken } from '@nestjs/mongoose'; | ||
|
||
// jest.useFakeTimers(); | ||
// jest.setTimeout(25000); | ||
|
||
// describe('App (e2e)', () => { | ||
// let app: INestApplication; | ||
// let connection: Connection; | ||
|
||
// // const url = `mongodb://dev-seeder-root:hpYpxyjrKExNQviu@devseeder-shard-00-00.v6xtv.mongodb.net:27017,devseeder-shard-00-01.v6xtv.mongodb.net:27017,devseeder-shard-00-02.v6xtv.mongodb.net:27017/places?ssl=true&replicaSet=atlas-4xi3m3-shard-0&authSource=admin&retryWrites=true&w=majority`; | ||
|
||
// beforeAll(async () => { | ||
// const module = await Test.createTestingModule({ | ||
// imports: [AppModule] | ||
// }).compile(); | ||
|
||
// connection = await module.get(getConnectionToken()); | ||
|
||
// app = await module.createNestApplication(); | ||
// await app.init(); | ||
// }); | ||
|
||
// afterEach(async () => { | ||
// await app.close(); | ||
// }); | ||
|
||
// afterAll(async () => { | ||
// await connection.close(/*force:*/ true); // <-- important | ||
// }); | ||
|
||
// it('1 = 1', async () => { | ||
// expect(1).to.be.equal(1); | ||
// }); | ||
|
||
// it('/neighborhoods/city/brasil/sc/orleans (GET)', async () => { | ||
// const actual = await request(app.getHttpServer()) | ||
// .get('/neighborhoods/city/brasil/sc/orleans') | ||
// .expect(200); | ||
|
||
// expect(actual.body).to.be.an('array').that.is.not.empty; | ||
// }); | ||
// }); |