Created
February 5, 2019 06:37
-
-
Save bewarusman/2cc0ae4a7378502214a953c3794283eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const chai = require('chai'); | |
const sinon = require('sinon'); | |
const expect = chai.expect; | |
const {createTodo, listTodos} = require('./todoController'); | |
describe('todoController', function() { | |
beforeEach(function() { | |
req = {body: {text: 'Go to the meeting!'}, db: {TodoModel: {create: null, findAll: null}}}; | |
res = {json: sinon.fake()}; | |
next = sinon.fake(); | |
}); | |
afterEach(function() { | |
sinon.restore(); | |
}); | |
describe('createTodo', function() { | |
it('text should be provided'); | |
it('should send success result if todo is saved to database'); | |
it('should send fail result if todo is not saved to database'); | |
}); | |
describe('fetchTodos', function() { | |
it('should send a list of todos with success message'); | |
it('should send fail result if todo is not fetched from database'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment