зеркало из https://github.com/electron/electron.git
Merge pull request #8539 from electron/require-wrapper
Update require wrapper to allow redefinition of process and global
This commit is contained in:
Коммит
37eebb1dd0
|
@ -0,0 +1,2 @@
|
|||
const global = 'declared global'
|
||||
module.exports = global
|
|
@ -0,0 +1,2 @@
|
|||
const process = 'declared process'
|
||||
module.exports = process
|
|
@ -47,6 +47,20 @@ describe('third-party module', function () {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('global variables', function () {
|
||||
describe('process', function () {
|
||||
it('can be declared in a module', function () {
|
||||
assert.strictEqual(require('./fixtures/module/declare-process'), 'declared process')
|
||||
})
|
||||
})
|
||||
|
||||
describe('global', function () {
|
||||
it('can be declared in a module', function () {
|
||||
assert.strictEqual(require('./fixtures/module/declare-global'), 'declared global')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Module._nodeModulePaths', function () {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 494083b740949caa93aca64ce75fe75c31e2034e
|
||||
Subproject commit 0bf9958c91e7aed26d5d474b4ca59d3dce3e5e05
|
Загрузка…
Ссылка в новой задаче