Move require spec to api-app-spec
This commit is contained in:
parent
4a41311409
commit
5e2f36387f
2 changed files with 32 additions and 33 deletions
|
@ -3,10 +3,9 @@ const ChildProcess = require('child_process')
|
|||
const https = require('https')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const remote = require('electron').remote
|
||||
const {remote} = require('electron')
|
||||
|
||||
const app = remote.require('electron').app
|
||||
const BrowserWindow = remote.require('electron').BrowserWindow
|
||||
const {app, BrowserWindow, ipcMain} = remote
|
||||
const isCI = remote.getGlobal('isCi')
|
||||
|
||||
describe('electron module', function () {
|
||||
|
@ -15,6 +14,36 @@ describe('electron module', function () {
|
|||
require('clipboard')
|
||||
}, /Cannot find module 'clipboard'/)
|
||||
})
|
||||
|
||||
describe('require("electron")', function () {
|
||||
let window = null
|
||||
|
||||
beforeEach(function () {
|
||||
if (window != null) {
|
||||
window.destroy()
|
||||
}
|
||||
window = new BrowserWindow({
|
||||
show: false,
|
||||
width: 400,
|
||||
height: 400
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
if (window != null) {
|
||||
window.destroy()
|
||||
}
|
||||
window = null
|
||||
})
|
||||
|
||||
it('always returns the internal electron module', function (done) {
|
||||
ipcMain.once('answer', function () {
|
||||
done()
|
||||
})
|
||||
window.loadURL('file://' + path.join(__dirname, 'fixtures', 'api', 'electron-module-app', 'index.html'))
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
describe('app module', function () {
|
||||
|
|
|
@ -4,7 +4,6 @@ const fs = require('fs')
|
|||
const path = require('path')
|
||||
const os = require('os')
|
||||
const {remote} = require('electron')
|
||||
const {BrowserWindow, ipcMain} = remote
|
||||
|
||||
describe('node feature', function () {
|
||||
var fixtures = path.join(__dirname, 'fixtures')
|
||||
|
@ -229,33 +228,4 @@ describe('node feature', function () {
|
|||
require('vm').runInNewContext('')
|
||||
})
|
||||
})
|
||||
|
||||
describe('require("electron")', function () {
|
||||
let window = null
|
||||
|
||||
beforeEach(function () {
|
||||
if (window != null) {
|
||||
window.destroy()
|
||||
}
|
||||
window = new BrowserWindow({
|
||||
show: false,
|
||||
width: 400,
|
||||
height: 400
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
if (window != null) {
|
||||
window.destroy()
|
||||
}
|
||||
window = null
|
||||
})
|
||||
|
||||
it('always returns the internal electron module', function (done) {
|
||||
ipcMain.once('answer', function () {
|
||||
done()
|
||||
})
|
||||
window.loadURL('file://' + path.join(__dirname, 'fixtures', 'api', 'electron-module-app', 'index.html'))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue