Skip to content

Instantly share code, notes, and snippets.

View AhmedCommando's full-sized avatar
:octocat:
Having Fun

AhmedCommando

:octocat:
Having Fun
View GitHub Profile
@AhmedCommando
AhmedCommando / winston-logger.ts
Created July 6, 2019 08:12
winston logger for development mode
const { createLogger, transports } = require('winston');
const defaultLevel = process.env.LOG_LEVEL || 'info';
const options = {
exitOnError: false,
level: defaultLevel
};
const logger = new createLogger(options);
@AhmedCommando
AhmedCommando / helloWorld.test.ts
Created July 6, 2019 12:02
helloWorld test using mocha/chai and supertest
import { expect } from 'chai';
import { agent as request } from 'supertest';
import 'mocha';
import App from '../src/index';
describe('baseRoute', () => {
it('should GET', async () => {
const res = await request(App).get('/');
// we check the status