Skip to content

Commit bc162c8

Browse files
committed
[misc] test/unit: add support for lazy global propagation in node v12
explicitly add `Buffer` and `process` as global See `https://github.com/nodejs/node/pull/26882` Signed-off-by: Jakob Ackermann <[email protected]>
1 parent 33dc94d commit bc162c8

File tree

6 files changed

+9
-1
lines changed

6 files changed

+9
-1
lines changed

test/unit/src/TokenAccess/TokenAccessHandlerTests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('TokenAccessHandler', function() {
3535
this.req = {}
3636
return (this.TokenAccessHandler = SandboxedModule.require(modulePath, {
3737
globals: {
38+
Buffer: Buffer,
3839
console: console
3940
},
4041
requires: {

test/unit/src/User/UserEmailsConfirmationHandlerTests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('UserEmailsConfirmationHandler', function() {
2727
beforeEach(function() {
2828
this.UserEmailsConfirmationHandler = SandboxedModule.require(modulePath, {
2929
globals: {
30+
process: process,
3031
console: console
3132
},
3233
requires: {

test/unit/src/infrastructure/FaultTolerantRequestTests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe('FaultTolerantRequest', function() {
1515
}
1616
this.FaultTolerantRequest = SandboxedModule.require(modulePath, {
1717
globals: {
18+
process: process,
1819
console: console
1920
},
2021
requires: {

test/unit/src/infrastructure/LockManager/ReleasingTheLock.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ describe('LockManager - releasing the lock', function() {
3737
}
3838
}
3939

40-
const LockManager = SandboxedModule.require(modulePath, { requires: mocks })
40+
const LockManager = SandboxedModule.require(modulePath, {
41+
requires: mocks,
42+
globals: { process }
43+
})
4144
LockManager.unlockScript = 'this is the unlock script'
4245

4346
it('should put a all data into memory', function(done) {

test/unit/src/infrastructure/LockManager/getLockTests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('LockManager - getting the lock', function() {
2727
beforeEach(function() {
2828
this.LockManager = SandboxedModule.require(modulePath, {
2929
globals: {
30+
process: process,
3031
console: console
3132
},
3233
requires: {

test/unit/src/infrastructure/LockManager/tryLockTests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe('LockManager - trying the lock', function() {
2424
beforeEach(function() {
2525
this.LockManager = SandboxedModule.require(modulePath, {
2626
globals: {
27+
process: process,
2728
console: console
2829
},
2930
requires: {

0 commit comments

Comments
 (0)