[misc] back-fill stubbing of mongodb package in sandboxed-module imports (#3209)
* [misc] back-fill stubbing of mongodb package in sandboxed-module imports Unit tests are about 10 percent faster: 9m16s vs 10m8s. * [misc] stubs: app code should have access to the ObjectId only GitOrigin-RevId: 9a52186e190863c9463b3aeb98c3db68011926e4
This commit is contained in:
@@ -4,6 +4,7 @@ const modulePath =
|
||||
'../../../../app/src/Features/Project/ProjectCreationHandler.js'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const Path = require('path')
|
||||
const { ObjectId } = require('mongodb')
|
||||
|
||||
describe('ProjectCreationHandler', function() {
|
||||
const ownerId = '4eecb1c1bffa66588e0000a1'
|
||||
@@ -64,6 +65,7 @@ describe('ProjectCreationHandler', function() {
|
||||
console: console
|
||||
},
|
||||
requires: {
|
||||
mongodb: { ObjectId },
|
||||
'../../models/User': {
|
||||
User: this.User
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user