This file contains 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
import express from 'express'; | |
const port = process.env.PORT || 4000; | |
const app = express(); | |
// This is where the magic happens. | |
// We write the case needed for our test to pass | |
app.get('/', (req, res) => { | |
res.status(200).json({ | |
message: 'Hello Books' |
This file contains 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
// Import the testing dependencies | |
import chai from 'chai'; | |
import chaiHttp from 'chai-http'; | |
import app from '../../'; | |
describe('App Root', () => { | |
it('should return status 200 and a message attribute', (done) => { | |
chai.request(app) | |
.get('/') | |
.end((err, res) => { |