mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 21:13:43 -05:00
commit
3cc72d349c
9 changed files with 78 additions and 76 deletions
|
@ -17,13 +17,13 @@ clean:
|
||||||
docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
||||||
|
|
||||||
format:
|
format:
|
||||||
$(DOCKER_COMPOSE) run --rm test_unit npm run format || true
|
$(DOCKER_COMPOSE) run --rm test_unit npm run format
|
||||||
|
|
||||||
format_fix:
|
format_fix:
|
||||||
$(DOCKER_COMPOSE) run --rm test_unit npm run format:fix
|
$(DOCKER_COMPOSE) run --rm test_unit npm run format:fix
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
$(DOCKER_COMPOSE) run --rm test_unit npm run lint || true
|
$(DOCKER_COMPOSE) run --rm test_unit npm run lint
|
||||||
|
|
||||||
test: format lint test_unit test_acceptance
|
test: format lint test_unit test_acceptance
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ module.exports = ContactManager = {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;['touchContact', 'getContacts'].map(method =>
|
;['touchContact', 'getContacts'].map((method) =>
|
||||||
metrics.timeAsyncMethod(
|
metrics.timeAsyncMethod(
|
||||||
ContactManager,
|
ContactManager,
|
||||||
method,
|
method,
|
||||||
|
|
|
@ -70,7 +70,7 @@ module.exports = HttpController = {
|
||||||
|
|
||||||
HttpController._sortContacts(contacts)
|
HttpController._sortContacts(contacts)
|
||||||
contacts = contacts.slice(0, limit)
|
contacts = contacts.slice(0, limit)
|
||||||
const contact_ids = contacts.map(contact => contact.user_id)
|
const contact_ids = contacts.map((contact) => contact.user_id)
|
||||||
|
|
||||||
return res.status(200).send({
|
return res.status(200).send({
|
||||||
contact_ids
|
contact_ids
|
||||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
||||||
} else {
|
} else {
|
||||||
this.initing = true
|
this.initing = true
|
||||||
this.callbacks.push(callback)
|
this.callbacks.push(callback)
|
||||||
return app.listen(3036, 'localhost', error => {
|
return app.listen(3036, 'localhost', (error) => {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,11 +66,11 @@ describe('Getting Contacts', function() {
|
||||||
return async.series(
|
return async.series(
|
||||||
[
|
[
|
||||||
// 2 is preferred since touched twice, then 3 since most recent, then 1
|
// 2 is preferred since touched twice, then 3 since most recent, then 1
|
||||||
cb => ContactsApp.ensureRunning(cb),
|
(cb) => ContactsApp.ensureRunning(cb),
|
||||||
cb => touchContact(this.user_id, this.contact_id_1, cb),
|
(cb) => touchContact(this.user_id, this.contact_id_1, cb),
|
||||||
cb => touchContact(this.user_id, this.contact_id_2, cb),
|
(cb) => touchContact(this.user_id, this.contact_id_2, cb),
|
||||||
cb => touchContact(this.user_id, this.contact_id_2, cb),
|
(cb) => touchContact(this.user_id, this.contact_id_2, cb),
|
||||||
cb => touchContact(this.user_id, this.contact_id_3, cb)
|
(cb) => touchContact(this.user_id, this.contact_id_3, cb)
|
||||||
],
|
],
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
|
@ -59,7 +59,7 @@ describe('ContactManager', function() {
|
||||||
.calledWith(
|
.calledWith(
|
||||||
{
|
{
|
||||||
user_id: sinon.match(
|
user_id: sinon.match(
|
||||||
o => o.toString() === this.user_id.toString()
|
(o) => o.toString() === this.user_id.toString()
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,9 @@ describe('ContactManager', function() {
|
||||||
it("should find the user's contacts", function () {
|
it("should find the user's contacts", function () {
|
||||||
return this.db.contacts.findOne
|
return this.db.contacts.findOne
|
||||||
.calledWith({
|
.calledWith({
|
||||||
user_id: sinon.match(o => o.toString() === this.user_id.toString())
|
user_id: sinon.match(
|
||||||
|
(o) => o.toString() === this.user_id.toString()
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.should.equal(true)
|
.should.equal(true)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue