Update specs for internal module require

This commit is contained in:
Kevin Sawicki 2016-04-28 09:58:59 -07:00
parent ef801d5543
commit bea232f53a

View file

@ -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'/)
})
})