Skip to content

Instantly share code, notes, and snippets.

View aupous's full-sized avatar

TuanPV aupous

  • FPT University
  • Hanoi, Vietnam
View GitHub Profile
TYPEORM_CONNECTION=postgres
TYPEORM_HOST=127.0.0.1
TYPEORM_PORT=5432
TYPEORM_DATABASE=feedbee_test
TYPEORM_USERNAME=postgres
TYPEORM_PASSWORD=postgres
TYPEORM_ENTITIES=dist/**/*.entity.js
TYPEORM_SYNCHRONIZE=true
TYPEORM_LOGGING = false
import { INestApplication, ValidationPipe } from '@nestjs/common';
import { CompanyService } from '../src/company/company.service';
import { TestData } from './testdata';
import { TestingModule, Test } from '@nestjs/testing';
import { AppModule } from '../src/app.module';
import { UserService } from '../src/user/user.service';
import * as request from 'supertest';
import { CompanyQuestionService } from '../src/company-question/company-question.service';
import { AuthService } from '../src/auth/auth.service';
import { UserQuestionService } from '../src/user-question/user-question.service';
{
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": ".",
"testEnvironment": "node",
"testRegex": ".e2e-spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"globalSetup": "<rootDir>/setup.ts"
}
require('dotenv').config({
path: '.env.test',
});
import { getConnectionManager, ConnectionOptions } from 'typeorm';
import databaseConfig from '../src/config/database';
export default async () => {
const connectionManager = getConnectionManager();
databaseConfig.synchronize = false;
import * as qs from 'querystring';
import * as fs from 'fs';
import * as jwt from 'jsonwebtoken';
import * as path from 'path';
// create client secret
const iat = Math.ceil(new Date().getTime() / 1000);
const exp = iat + 15777000;
const privateKey = fs.readFileSync(
path.join(__dirname, '../../assets/{auth-key-file-name}.p8'),
@aupous
aupous / socket-cheatsheet.js
Created April 21, 2020 16:38 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender

Keybase proof

I hereby claim:

  • I am aupous on github.
  • I am aupous (https://keybase.io/aupous) on keybase.
  • I have a public key ASCUrHj1dBzq-f9b0rDvJStqqG8eEWpeYTgtloXrcCy3xAo

To claim this, I am signing this object: