mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-23 02:55:13 -04:00
7588393580
Enforce consistent callback style in mocha tests GitOrigin-RevId: a64c293dae6926ef5831abe97eaf2044942a5c85
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
/* eslint-disable
|
|
handle-callback-err,
|
|
max-len,
|
|
no-unused-vars,
|
|
*/
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
// Fix any style issues and re-enable lint.
|
|
/*
|
|
* decaffeinate suggestions:
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
*/
|
|
const { expect } = require('chai')
|
|
const async = require('async')
|
|
const User = require('./helpers/User')
|
|
|
|
describe('Project CRUD', function() {
|
|
beforeEach(function(done) {
|
|
this.user = new User()
|
|
return this.user.login(done)
|
|
})
|
|
|
|
describe("when project doesn't exist", function() {
|
|
it('should return 404', function(done) {
|
|
return this.user.request.get(
|
|
'/project/aaaaaaaaaaaaaaaaaaaaaaaa',
|
|
(err, res, body) => {
|
|
expect(res.statusCode).to.equal(404)
|
|
return done()
|
|
}
|
|
)
|
|
})
|
|
})
|
|
|
|
describe('when project has malformed id', function() {
|
|
it('should return 404', function(done) {
|
|
return this.user.request.get('/project/blah', (err, res, body) => {
|
|
expect(res.statusCode).to.equal(404)
|
|
return done()
|
|
})
|
|
})
|
|
})
|
|
})
|