Skip to content

Instantly share code, notes, and snippets.

@amrvitale
Last active July 22, 2020 01:07
Show Gist options
  • Save amrvitale/a04d794a5978e0e2b9d2be295c4aa994 to your computer and use it in GitHub Desktop.
Save amrvitale/a04d794a5978e0e2b9d2be295c4aa994 to your computer and use it in GitHub Desktop.
const { expect } = require('chai');
const supertest = require('supertest');
const app = require('../app');
describe('GET /drafting', () => {
it('should return an draftling/s page', () => {
return supertest(app)
.get('/')
.expect(200)
.expect('Content-Type', /json/)
.then(res => {
expect(res.body).to.be.an('array');
});
})
});
describe('POST /draftling', () => {
it('should post a draftling', () => {
return supertest(app)
.post('/')
.expect(200)
.expect('Content-Type', /json/)
.then(res => {
expect(res.body).to.be.an('object');
});
})
})
describe('PUT /draftling', () => {
it('should return an draftling/s page', () => {
return supertest(app)
.put('/')
.expect(200)
.expect('Content-Type', /json/)
.then(res => {
expect(res.body).to.be.an('array');
});
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment