Skip to content

Commit

Permalink
disable e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
maick05 committed Jun 20, 2022
1 parent a43966b commit 0a48d59
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 49 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/e2e-tests.yml
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

77 changes: 48 additions & 29 deletions test/e2e/app.e2e-spec.ts
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;
// });
// });

0 comments on commit 0a48d59

Please sign in to comment.