Skip to content

Commit

Permalink
[misc] test/unit: add support for lazy global propagation in node v12
Browse files Browse the repository at this point in the history
explicitly add `Buffer` and `process` as global

See `https://github.com/nodejs/node/pull/26882`

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
  • Loading branch information
das7pad committed Nov 5, 2019
1 parent 33dc94d commit bc162c8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/unit/src/TokenAccess/TokenAccessHandlerTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('TokenAccessHandler', function() {
this.req = {}
return (this.TokenAccessHandler = SandboxedModule.require(modulePath, {
globals: {
Buffer: Buffer,
console: console
},
requires: {
Expand Down
1 change: 1 addition & 0 deletions test/unit/src/User/UserEmailsConfirmationHandlerTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('UserEmailsConfirmationHandler', function() {
beforeEach(function() {
this.UserEmailsConfirmationHandler = SandboxedModule.require(modulePath, {
globals: {
process: process,
console: console
},
requires: {
Expand Down
1 change: 1 addition & 0 deletions test/unit/src/infrastructure/FaultTolerantRequestTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('FaultTolerantRequest', function() {
}
this.FaultTolerantRequest = SandboxedModule.require(modulePath, {
globals: {
process: process,
console: console
},
requires: {
Expand Down
5 changes: 4 additions & 1 deletion test/unit/src/infrastructure/LockManager/ReleasingTheLock.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ describe('LockManager - releasing the lock', function() {
}
}

const LockManager = SandboxedModule.require(modulePath, { requires: mocks })
const LockManager = SandboxedModule.require(modulePath, {
requires: mocks,
globals: { process }
})
LockManager.unlockScript = 'this is the unlock script'

it('should put a all data into memory', function(done) {
Expand Down
1 change: 1 addition & 0 deletions test/unit/src/infrastructure/LockManager/getLockTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('LockManager - getting the lock', function() {
beforeEach(function() {
this.LockManager = SandboxedModule.require(modulePath, {
globals: {
process: process,
console: console
},
requires: {
Expand Down
1 change: 1 addition & 0 deletions test/unit/src/infrastructure/LockManager/tryLockTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('LockManager - trying the lock', function() {
beforeEach(function() {
this.LockManager = SandboxedModule.require(modulePath, {
globals: {
process: process,
console: console
},
requires: {
Expand Down

0 comments on commit bc162c8

Please sign in to comment.