Update specs for internal module require
This commit is contained in:
parent
ef801d5543
commit
bea232f53a
1 changed files with 3 additions and 14 deletions
|
@ -9,21 +9,10 @@ const app = remote.require('electron').app
|
|||
const BrowserWindow = remote.require('electron').BrowserWindow
|
||||
|
||||
describe('electron module', function () {
|
||||
it('allows old style require by default', function () {
|
||||
require('shell')
|
||||
})
|
||||
|
||||
it('can prevent exposing internal modules to require', function (done) {
|
||||
const electron = require('electron')
|
||||
const clipboard = require('clipboard')
|
||||
assert.equal(typeof clipboard, 'object')
|
||||
electron.hideInternalModules()
|
||||
try {
|
||||
it('prevents exposing internal modules to require', function () {
|
||||
assert.throws(function () {
|
||||
require('clipboard')
|
||||
} catch (err) {
|
||||
assert.equal(err.message, "Cannot find module 'clipboard'")
|
||||
done()
|
||||
}
|
||||
}, /Cannot find module 'clipboard'/)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue