mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3185 from overleaf/jpa-normalize-mongo-imports
[misc] normalize mongo imports GitOrigin-RevId: ac653d9982e0d36736b90f4c03d4c00be88ea76a
This commit is contained in:
parent
2977d6ab9b
commit
018a44eeb5
69 changed files with 63 additions and 86 deletions
|
@ -6,7 +6,7 @@ const PrivilegeLevels = require('./PrivilegeLevels')
|
|||
const TokenAccessHandler = require('../TokenAccess/TokenAccessHandler')
|
||||
const PublicAccessLevels = require('./PublicAccessLevels')
|
||||
const Errors = require('../Errors/Errors')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { promisifyAll } = require('../../util/promises')
|
||||
|
||||
const AuthorizationManager = {
|
||||
|
|
|
@ -2,7 +2,7 @@ let AuthorizationMiddleware
|
|||
const AuthorizationManager = require('./AuthorizationManager')
|
||||
const async = require('async')
|
||||
const logger = require('logger-sharelatex')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Errors = require('../Errors/Errors')
|
||||
const HttpErrorHandler = require('../Errors/HttpErrorHandler')
|
||||
const AuthenticationController = require('../Authentication/AuthenticationController')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { callbackify } = require('util')
|
||||
const pLimit = require('p-limit')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const { Project } = require('../../models/Project')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const async = require('async')
|
||||
const _ = require('underscore')
|
||||
const { ObjectId } = require('../../infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { getInstitutionAffiliations } = require('./InstitutionsAPI')
|
||||
const FeaturesUpdater = require('../Subscription/FeaturesUpdater')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let ProjectCollabratecDetailsHandler
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { Project } = require('../../models/Project')
|
||||
|
||||
module.exports = ProjectCollabratecDetailsHandler = {
|
||||
|
|
|
@ -4,7 +4,7 @@ const fs = require('fs')
|
|||
const crypto = require('crypto')
|
||||
const async = require('async')
|
||||
const logger = require('logger-sharelatex')
|
||||
const { ObjectId } = require('../../infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const ProjectDeleter = require('./ProjectDeleter')
|
||||
const ProjectDuplicator = require('./ProjectDuplicator')
|
||||
const ProjectCreationHandler = require('./ProjectCreationHandler')
|
||||
|
|
|
@ -17,7 +17,7 @@ const OError = require('@overleaf/o-error')
|
|||
const async = require('async')
|
||||
const metrics = require('metrics-sharelatex')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { Project } = require('../../models/Project')
|
||||
const { Folder } = require('../../models/Folder')
|
||||
const ProjectEntityUpdateHandler = require('./ProjectEntityUpdateHandler')
|
||||
|
|
|
@ -13,11 +13,9 @@
|
|||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const mongojs = require('../../infrastructure/mongojs')
|
||||
const { db, ObjectId } = require('../../infrastructure/mongojs')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const metrics = require('metrics-sharelatex')
|
||||
const { db } = mongojs
|
||||
const { ObjectId } = mongojs
|
||||
const async = require('async')
|
||||
const { promisifyAll } = require('../../util/promises')
|
||||
const { Project } = require('../../models/Project')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('../../infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const _ = require('lodash')
|
||||
const { promisify } = require('util')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
|
|
@ -16,7 +16,6 @@ const { promisify } = require('util')
|
|||
const { Subscription } = require('../../models/Subscription')
|
||||
const { DeletedSubscription } = require('../../models/DeletedSubscription')
|
||||
const logger = require('logger-sharelatex')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
require('./GroupPlansData') // make sure dynamic group plans are loaded
|
||||
|
||||
const SubscriptionLocator = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { db } = require('../../infrastructure/mongojs')
|
||||
const { db, ObjectId } = require('../../infrastructure/mongojs')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const async = require('async')
|
||||
const { promisifyAll } = require('../../util/promises')
|
||||
|
@ -6,7 +6,6 @@ const { Subscription } = require('../../models/Subscription')
|
|||
const SubscriptionLocator = require('./SubscriptionLocator')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
const PlansLocator = require('./PlansLocator')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const FeaturesUpdater = require('./FeaturesUpdater')
|
||||
const { DeletedSubscription } = require('../../models/DeletedSubscription')
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const crypto = require('crypto')
|
|||
const async = require('async')
|
||||
|
||||
const settings = require('settings-sharelatex')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
const { Subscription } = require('../../models/Subscription')
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('../../infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const _ = require('lodash')
|
||||
const { callbackify } = require('util')
|
||||
const logger = require('logger-sharelatex')
|
||||
|
|
|
@ -2,7 +2,7 @@ const { Project } = require('../../models/Project')
|
|||
const PublicAccessLevels = require('../Authorization/PublicAccessLevels')
|
||||
const PrivilegeLevels = require('../Authorization/PrivilegeLevels')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const logger = require('logger-sharelatex')
|
||||
const V1Api = require('../V1/V1Api')
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
const mongojs = require('../../infrastructure/mongojs')
|
||||
const { db, ObjectId } = require('../../infrastructure/mongojs')
|
||||
const metrics = require('metrics-sharelatex')
|
||||
const logger = require('logger-sharelatex')
|
||||
const { db } = mongojs
|
||||
const { ObjectId } = mongojs
|
||||
const { promisifyAll } = require('../../util/promises')
|
||||
const { getUserAffiliations } = require('../Institutions/InstitutionsAPI')
|
||||
const InstitutionsHelper = require('../Institutions/InstitutionsHelper')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
let UserController
|
||||
const UserGetter = require('./UserGetter')
|
||||
const AuthenticationController = require('../Authentication/AuthenticationController')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
module.exports = UserController = {
|
||||
getLoggedInUsersPersonalInfo(req, res, next) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
const logger = require('logger-sharelatex')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const mongojs = require('../../infrastructure/mongojs')
|
||||
const { db, ObjectId } = require('../../infrastructure/mongojs')
|
||||
const metrics = require('metrics-sharelatex')
|
||||
const { db } = mongojs
|
||||
const async = require('async')
|
||||
const { ObjectId } = mongojs
|
||||
const { callbackify, promisify } = require('util')
|
||||
const UserGetter = require('./UserGetter')
|
||||
const {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
const async = require('async')
|
||||
const { promisifyAll } = require('../../util/promises')
|
||||
const Errors = require('../Errors/Errors')
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let UserMembershipViewModel
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
|
||||
module.exports = UserMembershipViewModel = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const { Joi: CelebrateJoi, celebrate, errors } = require('celebrate')
|
||||
const { ObjectId } = require('./mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
const objectIdValidator = {
|
||||
name: 'objectId',
|
||||
|
|
|
@ -15,7 +15,6 @@ const assert = require('assert')
|
|||
require('chai').should()
|
||||
const { expect } = require('chai')
|
||||
const sinon = require('sinon')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const modulePath = require('path').join(
|
||||
__dirname,
|
||||
'../../../app/src/LaunchpadController.js'
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const mongojs = require('../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../app/src/infrastructure/mongojs')
|
||||
const async = require('async')
|
||||
const minilist = require('minimist')
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const mongojs = require('../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../app/src/infrastructure/mongojs')
|
||||
const async = require('async')
|
||||
const minilist = require('minimist')
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const mongojs = require('../../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../../app/src/infrastructure/mongojs')
|
||||
|
||||
const keys = { 'tokens.readAndWritePrefix': 1 }
|
||||
const opts = {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const mongojs = require('../../app/src/infrastructure/mongojs')
|
||||
const { db, ObjectId } = mongojs
|
||||
const { db, ObjectId } = require('../../app/src/infrastructure/mongojs')
|
||||
const Async = require('async')
|
||||
|
||||
const projectIds = [
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const mongojs = require('../../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../../app/src/infrastructure/mongojs')
|
||||
const Async = require('async')
|
||||
|
||||
db.projects.find(
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const mongojs = require('../../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../../app/src/infrastructure/mongojs')
|
||||
const async = require('async')
|
||||
|
||||
db.deletedSubscriptions.aggregate(
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const NotificationsHandler = require('../../app/src/Features/Notifications/NotificationsHandler')
|
||||
|
||||
const mongojs = require('../../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../../app/src/infrastructure/mongojs')
|
||||
const async = require('async')
|
||||
|
||||
const templateKey = 'wfh_2020_upgrade_offer'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const NotificationsHandler = require('../../app/src/Features/Notifications/NotificationsHandler')
|
||||
|
||||
const mongojs = require('../../app/src/infrastructure/mongojs')
|
||||
const { db } = mongojs
|
||||
const { db } = require('../../app/src/infrastructure/mongojs')
|
||||
const async = require('async')
|
||||
|
||||
const templateKey = 'wfh_2020_upgrade_offer'
|
||||
|
|
|
@ -17,7 +17,7 @@ const async = require('async')
|
|||
const UserClient = require('./helpers/User')
|
||||
const request = require('./helpers/request')
|
||||
const settings = require('settings-sharelatex')
|
||||
const { ObjectId } = require('../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { Subscription } = require('../../../app/src/models/Subscription')
|
||||
const { User } = require('../../../app/src/models/User')
|
||||
const FeaturesUpdater = require('../../../app/src/Features/Subscription/FeaturesUpdater')
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
const _ = require('underscore')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const request = require('./helpers/request')
|
||||
|
||||
const MockProjectHistoryApi = require('./helpers/MockProjectHistoryApi')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const { expect } = require('chai')
|
||||
const User = require('./helpers/User').promises
|
||||
const { Project } = require('../../../app/src/models/Project')
|
||||
const { ObjectId } = require('../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('Project CRUD', function() {
|
||||
beforeEach(async function() {
|
||||
|
|
|
@ -19,7 +19,6 @@ const async = require('async')
|
|||
const { expect } = require('chai')
|
||||
const sinon = require('sinon')
|
||||
const mkdirp = require('mkdirp')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const Path = require('path')
|
||||
const fs = require('fs')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { expect } = require('chai')
|
||||
const mkdirp = require('mkdirp')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Path = require('path')
|
||||
const fs = require('fs')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const InstitutionModel = require('../../../../app/src/models/Institution')
|
||||
.Institution
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ const _ = require('lodash')
|
|||
const express = require('express')
|
||||
const bodyParser = require('body-parser')
|
||||
const app = express()
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
module.exports = MockProjectHistoryApi = {
|
||||
docs: {},
|
||||
|
|
|
@ -16,7 +16,6 @@ const _ = require('lodash')
|
|||
const express = require('express')
|
||||
const bodyParser = require('body-parser')
|
||||
const app = express()
|
||||
const { ObjectId } = require('mongojs')
|
||||
|
||||
module.exports = MockV1HistoryApi = {
|
||||
fakeZipCall: 0,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const PublisherModel = require('../../../../app/src/models/Publisher').Publisher
|
||||
|
||||
let count = parseInt(Math.random() * 999999)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Subscription = require('./Subscription')
|
||||
const MockRecurlyApi = require('./MockRecurlyApi')
|
||||
const RecurlyWrapper = require('../../../../app/src/Features/Subscription/RecurlyWrapper')
|
||||
|
|
|
@ -7,7 +7,7 @@ const SandboxedModule = require('sandboxed-module')
|
|||
const tk = require('timekeeper')
|
||||
const MockRequest = require('../helpers/MockRequest')
|
||||
const MockResponse = require('../helpers/MockResponse')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('AuthenticationController', function() {
|
||||
beforeEach(function() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const sinon = require('sinon')
|
||||
const chai = require('chai')
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const AuthenticationErrors = require('../../../../app/src/Features/Authentication/AuthenticationErrors')
|
||||
|
||||
chai.should()
|
||||
|
|
|
@ -36,7 +36,7 @@ describe('AuthorizationMiddleware', function() {
|
|||
requires: {
|
||||
'./AuthorizationManager': this.AuthorizationManager,
|
||||
'logger-sharelatex': { log() {} },
|
||||
mongojs: {
|
||||
mongodb: {
|
||||
ObjectId: this.ObjectId
|
||||
},
|
||||
'../Errors/HttpErrorHandler': this.HttpErrorHandler,
|
||||
|
|
|
@ -2,7 +2,7 @@ const Path = require('path')
|
|||
const SandboxedModule = require('sandboxed-module')
|
||||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { Project } = require('../helpers/models/Project')
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ const sinon = require('sinon')
|
|||
const { expect } = require('chai')
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
const { Project } = require('../helpers/models/Project')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
const MODULE_PATH = path.join(
|
||||
__dirname,
|
||||
|
|
|
@ -21,7 +21,7 @@ const SandboxedModule = require('sandboxed-module')
|
|||
const events = require('events')
|
||||
const MockRequest = require('../helpers/MockRequest')
|
||||
const MockResponse = require('../helpers/MockResponse')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('CollaboratorsInviteController', function() {
|
||||
beforeEach(function() {
|
||||
|
|
|
@ -22,7 +22,7 @@ const modulePath =
|
|||
'../../../../app/src/Features/Collaborators/CollaboratorsInviteHandler.js'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const events = require('events')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Crypto = require('crypto')
|
||||
|
||||
describe('CollaboratorsInviteHandler', function() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const sinon = require('sinon')
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const path = require('path')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const modulePath = path.join(
|
||||
__dirname,
|
||||
'../../../../app/src/Features/DocumentUpdater/DocumentUpdaterHandler'
|
||||
|
|
|
@ -83,7 +83,7 @@ describe('InstitutionsManager', function() {
|
|||
'../Subscription/SubscriptionLocator': this.SubscriptionLocator,
|
||||
'../../models/Institution': this.InstitutionModel,
|
||||
'../../models/Subscription': SubscriptionModel,
|
||||
'../../infrastructure/mongojs': this.Mongo,
|
||||
mongodb: this.Mongo,
|
||||
'../User/SAMLIdentityManager': this.SAMLIdentityManager
|
||||
}
|
||||
}))
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Path = require('path')
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const assert = require('assert')
|
||||
|
|
|
@ -7,7 +7,7 @@ const tk = require('timekeeper')
|
|||
const moment = require('moment')
|
||||
const { Project } = require('../helpers/models/Project')
|
||||
const { DeletedProject } = require('../helpers/models/DeletedProject')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
|
||||
describe('ProjectDeleter', function() {
|
||||
|
|
|
@ -20,7 +20,6 @@ const { expect } = chai
|
|||
const sinon = require('sinon')
|
||||
const modulePath = '../../../../app/src/Features/Project/ProjectEntityHandler'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
|
||||
describe('ProjectEntityHandler', function() {
|
||||
|
|
|
@ -2,7 +2,7 @@ const { expect } = require('chai')
|
|||
const sinon = require('sinon')
|
||||
const tk = require('timekeeper')
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { Project } = require('../helpers/models/Project')
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ const { expect } = chai
|
|||
const sinon = require('sinon')
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
const MODULE_PATH =
|
||||
'../../../../app/src/Features/Project/ProjectEntityUpdateHandler'
|
||||
|
|
|
@ -17,7 +17,7 @@ const should = chai.should()
|
|||
const { expect } = chai
|
||||
const modulePath = '../../../../app/src/Features/Project/ProjectGetter.js'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const { assert } = require('chai')
|
||||
|
||||
describe('ProjectGetter', function() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const chai = require('chai')
|
||||
const { expect } = chai
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
const MODULE_PATH = '../../../../app/src/Features/Project/ProjectHelper.js'
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ const { expect } = chai
|
|||
const sinon = require('sinon')
|
||||
const modulePath = '../../../../app/src/Features/Project/ProjectHistoryHandler'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
|
||||
describe('ProjectHistoryHandler', function() {
|
||||
const project_id = '4eecb1c1bffa66588e0000a1'
|
||||
|
|
|
@ -16,7 +16,7 @@ const { expect } = require('chai')
|
|||
const sinon = require('sinon')
|
||||
const modulePath = '../../../../app/src/Features/Subscription/FeaturesUpdater'
|
||||
const { assert } = require('chai')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('FeaturesUpdater', function() {
|
||||
beforeEach(function() {
|
||||
|
|
|
@ -17,7 +17,6 @@ const sinon = require('sinon')
|
|||
const modulePath =
|
||||
'../../../../app/src/Features/Subscription/SubscriptionLocator'
|
||||
const { assert } = require('chai')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
|
||||
describe('Subscription Locator Tests', function() {
|
||||
beforeEach(function() {
|
||||
|
|
|
@ -4,7 +4,7 @@ const sinon = require('sinon')
|
|||
const modulePath =
|
||||
'../../../../app/src/Features/Subscription/SubscriptionUpdater'
|
||||
const { assert } = require('chai')
|
||||
const { ObjectId } = require('mongoose').Types
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
chai.should()
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const { expect } = require('chai')
|
|||
const modulePath =
|
||||
'../../../../app/src/Features/Subscription/TeamInvitesHandler'
|
||||
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const Errors = require('../../../../app/src/Features/Errors/Errors')
|
||||
|
||||
describe('TeamInvitesHandler', function() {
|
||||
|
|
|
@ -3,7 +3,7 @@ const { expect } = require('chai')
|
|||
require('chai').should()
|
||||
const sinon = require('sinon')
|
||||
const { Tag } = require('../helpers/models/Tag')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const modulePath = require('path').join(
|
||||
__dirname,
|
||||
'../../../../app/src/Features/Tags/TagsHandler.js'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const chai = require('chai')
|
||||
const path = require('path')
|
||||
|
|
|
@ -21,7 +21,7 @@ const modulePath = path.join(
|
|||
'../../../../app/src/Features/TokenAccess/TokenAccessHandler'
|
||||
)
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('TokenAccessHandler', function() {
|
||||
beforeEach(function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const should = require('chai').should()
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const assert = require('assert')
|
||||
|
|
|
@ -20,7 +20,7 @@ const SandboxedModule = require('sandboxed-module')
|
|||
const events = require('events')
|
||||
const MockResponse = require('../helpers/MockResponse')
|
||||
const MockRequest = require('../helpers/MockRequest')
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('UserInfoController', function() {
|
||||
beforeEach(function() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const SandboxedModule = require('sandboxed-module')
|
||||
const modulePath =
|
||||
'../../../../app/src/Features/User/UserOnboardingController.js'
|
||||
const { ObjectId } = require('mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const sinon = require('sinon')
|
||||
|
||||
describe('UserOnboardingController', function() {
|
||||
|
|
|
@ -17,7 +17,7 @@ const { expect } = require('chai')
|
|||
const sinon = require('sinon')
|
||||
const assertCalledWith = sinon.assert.calledWith
|
||||
const assertNotCalled = sinon.assert.notCalled
|
||||
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const modulePath =
|
||||
'../../../../app/src/Features/UserMembership/UserMembershipHandler'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
|
|
|
@ -16,8 +16,7 @@ const { expect } = require('chai')
|
|||
const sinon = require('sinon')
|
||||
const assertCalledWith = sinon.assert.calledWith
|
||||
const assertNotCalled = sinon.assert.notCalled
|
||||
const mongojs = require('mongojs')
|
||||
const { ObjectId } = mongojs
|
||||
const { ObjectId } = require('mongodb')
|
||||
const modulePath =
|
||||
'../../../../app/src/Features/UserMembership/UserMembershipViewModel'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
|
@ -30,7 +29,7 @@ describe('UserMembershipViewModel', function() {
|
|||
console: console
|
||||
},
|
||||
requires: {
|
||||
mongojs: mongojs,
|
||||
mongodb: require('mongodb'),
|
||||
'../User/UserGetter': this.UserGetter
|
||||
}
|
||||
})
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
const sinon = require('sinon')
|
||||
const assertCalledWith = sinon.assert.calledWith
|
||||
const { ObjectId } = require('../../../../app/src/infrastructure/mongojs')
|
||||
const { ObjectId } = require('mongodb')
|
||||
const modulePath =
|
||||
'../../../../app/src/Features/UserMembership/UserMembershipsHandler'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
|
|
Loading…
Reference in a new issue