Skip to content

Instantly share code, notes, and snippets.

View oluwajuwon's full-sized avatar
🏠
Working from home

Oluwajuwon oluwajuwon

🏠
Working from home
View GitHub Profile
@oluwajuwon
oluwajuwon / newArticleTest.txt
Last active November 22, 2018 19:47
This test is for a post request to the article endpoint. From the test, you can see the values I initialised and sent to the endpoint. I also imported my token generation controller to be able to generate a token for the test user to be able to post a new article. The test is supposed to return a status of 201 if the article was successfully posted
import { expect } from 'chai';
import request from 'supertest';
import app from '../app';
import generateToken from '../controllers/generateToken';
const user = { user: { userId: 1, userType: 'Author' } };
const userToken = generateToken.createToken(user);