diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index 259ff09a36..b379a2daec 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -7,9 +7,9 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import { promisify } from 'util'; import { app, BrowserWindow, Menu, session, net as electronNet } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { closeWindow, closeAllWindows } from './window-helpers'; -import { ifdescribe, ifit, waitUntil } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { closeWindow, closeAllWindows } from './lib/window-helpers'; +import { ifdescribe, ifit, waitUntil } from './lib/spec-helpers'; import split = require('split') const fixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-auto-updater-spec.ts b/spec/api-auto-updater-spec.ts index c5bbbc06f0..27183c9621 100644 --- a/spec/api-auto-updater-spec.ts +++ b/spec/api-auto-updater-spec.ts @@ -1,7 +1,7 @@ import { autoUpdater } from 'electron/main'; import { expect } from 'chai'; -import { ifit, ifdescribe } from './spec-helpers'; -import { emittedOnce } from './events-helpers'; +import { ifit, ifdescribe } from './lib/spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; ifdescribe(!process.mas)('autoUpdater module', function () { describe('checkForUpdates', function () { diff --git a/spec/api-autoupdater-darwin-spec.ts b/spec/api-autoupdater-darwin-spec.ts index 0ea8674f3d..7eaf6d8b4e 100644 --- a/spec/api-autoupdater-darwin-spec.ts +++ b/spec/api-autoupdater-darwin-spec.ts @@ -7,7 +7,7 @@ import * as os from 'os'; import * as path from 'path'; import * as psList from 'ps-list'; import { AddressInfo } from 'net'; -import { ifdescribe, ifit } from './spec-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; import * as uuid from 'uuid'; import { systemPreferences } from 'electron'; diff --git a/spec/api-browser-view-spec.ts b/spec/api-browser-view-spec.ts index a87d2dff7b..47557c233c 100644 --- a/spec/api-browser-view-spec.ts +++ b/spec/api-browser-view-spec.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; import * as path from 'path'; -import { emittedOnce } from './events-helpers'; +import { emittedOnce } from './lib/events-helpers'; import { BrowserView, BrowserWindow, screen, webContents } from 'electron/main'; -import { closeWindow } from './window-helpers'; -import { defer, ifit, startRemoteControlApp } from './spec-helpers'; -import { areColorsSimilar, captureScreen, getPixelColor } from './screen-helpers'; +import { closeWindow } from './lib/window-helpers'; +import { defer, ifit, startRemoteControlApp } from './lib/spec-helpers'; +import { areColorsSimilar, captureScreen, getPixelColor } from './lib/screen-helpers'; describe('BrowserView module', () => { const fixtures = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index 82b1614523..e6e101f612 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -7,10 +7,10 @@ import * as http from 'http'; import { AddressInfo } from 'net'; import { app, BrowserWindow, BrowserView, dialog, ipcMain, OnBeforeSendHeadersListenerDetails, protocol, screen, webContents, session, WebContents } from 'electron/main'; -import { emittedOnce, emittedUntil, emittedNTimes } from './events-helpers'; -import { ifit, ifdescribe, defer, delay } from './spec-helpers'; -import { closeWindow, closeAllWindows } from './window-helpers'; -import { areColorsSimilar, captureScreen, HexColors, getPixelColor } from './screen-helpers'; +import { emittedOnce, emittedUntil, emittedNTimes } from './lib/events-helpers'; +import { ifit, ifdescribe, defer, delay } from './lib/spec-helpers'; +import { closeWindow, closeAllWindows } from './lib/window-helpers'; +import { areColorsSimilar, captureScreen, HexColors, getPixelColor } from './lib/screen-helpers'; const features = process._linkedBinding('electron_common_features'); const fixtures = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-clipboard-spec.ts b/spec/api-clipboard-spec.ts index 604c8d03bf..69ba70e06a 100644 --- a/spec/api-clipboard-spec.ts +++ b/spec/api-clipboard-spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as path from 'path'; import { Buffer } from 'buffer'; -import { ifdescribe, ifit } from './spec-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; import { clipboard, nativeImage } from 'electron/common'; // FIXME(zcbenz): Clipboard tests are failing on WOA. diff --git a/spec/api-content-tracing-spec.ts b/spec/api-content-tracing-spec.ts index 7f36fc18da..eb1b5e35d5 100644 --- a/spec/api-content-tracing-spec.ts +++ b/spec/api-content-tracing-spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { app, contentTracing, TraceConfig, TraceCategoriesAndOptions } from 'electron/main'; import * as fs from 'fs'; import * as path from 'path'; -import { ifdescribe, delay } from './spec-helpers'; +import { ifdescribe, delay } from './lib/spec-helpers'; // FIXME: The tests are skipped on arm/arm64 and ia32. ifdescribe(!(['arm', 'arm64', 'ia32'].includes(process.arch)))('contentTracing', () => { diff --git a/spec/api-context-bridge-spec.ts b/spec/api-context-bridge-spec.ts index 8a2041f264..81133f633a 100644 --- a/spec/api-context-bridge-spec.ts +++ b/spec/api-context-bridge-spec.ts @@ -7,8 +7,8 @@ import * as os from 'os'; import * as path from 'path'; import * as cp from 'child_process'; -import { closeWindow } from './window-helpers'; -import { emittedOnce } from './events-helpers'; +import { closeWindow } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; import { AddressInfo } from 'net'; const fixturesPath = path.resolve(__dirname, 'fixtures', 'api', 'context-bridge'); diff --git a/spec/api-crash-reporter-spec.ts b/spec/api-crash-reporter-spec.ts index c81d92d8ec..7f6c1f9f4c 100644 --- a/spec/api-crash-reporter-spec.ts +++ b/spec/api-crash-reporter-spec.ts @@ -3,7 +3,7 @@ import * as childProcess from 'child_process'; import * as http from 'http'; import * as Busboy from 'busboy'; import * as path from 'path'; -import { ifdescribe, ifit, defer, startRemoteControlApp, delay, repeatedly } from './spec-helpers'; +import { ifdescribe, ifit, defer, startRemoteControlApp, delay, repeatedly } from './lib/spec-helpers'; import { app } from 'electron/main'; import { crashReporter } from 'electron/common'; import { AddressInfo } from 'net'; diff --git a/spec/api-debugger-spec.ts b/spec/api-debugger-spec.ts index aff035a6c9..75ff74d91e 100644 --- a/spec/api-debugger-spec.ts +++ b/spec/api-debugger-spec.ts @@ -3,8 +3,8 @@ import * as http from 'http'; import * as path from 'path'; import { AddressInfo } from 'net'; import { BrowserWindow } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce, emittedUntil } from './events-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce, emittedUntil } from './lib/events-helpers'; describe('debugger module', () => { const fixtures = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-desktop-capturer-spec.ts b/spec/api-desktop-capturer-spec.ts index ad343b9305..864bec5828 100644 --- a/spec/api-desktop-capturer-spec.ts +++ b/spec/api-desktop-capturer-spec.ts @@ -1,9 +1,9 @@ import { expect } from 'chai'; import { screen, desktopCapturer, BrowserWindow } from 'electron/main'; -import { delay, ifdescribe, ifit } from './spec-helpers'; -import { emittedOnce } from './events-helpers'; +import { delay, ifdescribe, ifit } from './lib/spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; -import { closeAllWindows } from './window-helpers'; +import { closeAllWindows } from './lib/window-helpers'; const features = process._linkedBinding('electron_common_features'); diff --git a/spec/api-dialog-spec.ts b/spec/api-dialog-spec.ts index 2b520075ae..669f759615 100644 --- a/spec/api-dialog-spec.ts +++ b/spec/api-dialog-spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { dialog, BrowserWindow } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; -import { ifit, delay } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { ifit, delay } from './lib/spec-helpers'; describe('dialog module', () => { describe('showOpenDialog', () => { diff --git a/spec/api-global-shortcut-spec.ts b/spec/api-global-shortcut-spec.ts index 36d5191e56..b1c009329d 100644 --- a/spec/api-global-shortcut-spec.ts +++ b/spec/api-global-shortcut-spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { globalShortcut } from 'electron/main'; -import { ifdescribe } from './spec-helpers'; +import { ifdescribe } from './lib/spec-helpers'; ifdescribe(process.platform !== 'win32')('globalShortcut module', () => { beforeEach(() => { diff --git a/spec/api-ipc-main-spec.ts b/spec/api-ipc-main-spec.ts index 614020561f..c09a0e1492 100644 --- a/spec/api-ipc-main-spec.ts +++ b/spec/api-ipc-main-spec.ts @@ -1,9 +1,9 @@ import { expect } from 'chai'; import * as path from 'path'; import * as cp from 'child_process'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { defer } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { defer } from './lib/spec-helpers'; import { ipcMain, BrowserWindow } from 'electron/main'; describe('ipc main module', () => { diff --git a/spec/api-ipc-renderer-spec.ts b/spec/api-ipc-renderer-spec.ts index 861dbe6e44..f397495a9a 100644 --- a/spec/api-ipc-renderer-spec.ts +++ b/spec/api-ipc-renderer-spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; import * as path from 'path'; import { ipcMain, BrowserWindow, WebContents, WebPreferences, webContents } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { closeWindow } from './window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { closeWindow } from './lib/window-helpers'; describe('ipcRenderer module', () => { const fixtures = path.join(__dirname, 'fixtures'); diff --git a/spec/api-ipc-spec.ts b/spec/api-ipc-spec.ts index c63c9ba94e..efcb7c02e6 100644 --- a/spec/api-ipc-spec.ts +++ b/spec/api-ipc-spec.ts @@ -1,9 +1,9 @@ import { EventEmitter } from 'events'; import { expect } from 'chai'; import { BrowserWindow, ipcMain, IpcMainInvokeEvent, MessageChannelMain, WebContents } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { defer } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { defer } from './lib/spec-helpers'; import * as path from 'path'; import * as http from 'http'; import { AddressInfo } from 'net'; diff --git a/spec/api-media-handler-spec.ts b/spec/api-media-handler-spec.ts index 65dab3690f..e54a2be206 100644 --- a/spec/api-media-handler-spec.ts +++ b/spec/api-media-handler-spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; import { BrowserWindow, session, desktopCapturer } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; +import { closeAllWindows } from './lib/window-helpers'; import * as http from 'http'; -import { ifdescribe, ifit } from './spec-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; const features = process._linkedBinding('electron_common_features'); diff --git a/spec/api-menu-item-spec.ts b/spec/api-menu-item-spec.ts index 268c223ec0..39b50e0df8 100644 --- a/spec/api-menu-item-spec.ts +++ b/spec/api-menu-item-spec.ts @@ -1,6 +1,6 @@ import { BrowserWindow, app, Menu, MenuItem, MenuItemConstructorOptions } from 'electron/main'; import { expect } from 'chai'; -import { closeAllWindows } from './window-helpers'; +import { closeAllWindows } from './lib/window-helpers'; const { roleList, execute } = require('../lib/browser/api/menu-item-roles'); describe('MenuItems', () => { diff --git a/spec/api-menu-spec.ts b/spec/api-menu-spec.ts index 5f8ba03c84..5c47ee01f7 100644 --- a/spec/api-menu-spec.ts +++ b/spec/api-menu-spec.ts @@ -3,9 +3,9 @@ import * as path from 'path'; import { expect } from 'chai'; import { BrowserWindow, Menu, MenuItem } from 'electron/main'; import { sortMenuItems } from '../lib/browser/api/menu-utils'; -import { emittedOnce } from './events-helpers'; -import { ifit, delay } from './spec-helpers'; -import { closeWindow } from './window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { ifit, delay } from './lib/spec-helpers'; +import { closeWindow } from './lib/window-helpers'; const fixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-native-image-spec.ts b/spec/api-native-image-spec.ts index 65449733a9..d86f31db00 100644 --- a/spec/api-native-image-spec.ts +++ b/spec/api-native-image-spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { nativeImage } from 'electron/common'; -import { ifdescribe, ifit } from './spec-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; import * as path from 'path'; describe('nativeImage module', () => { diff --git a/spec/api-native-theme-spec.ts b/spec/api-native-theme-spec.ts index d813a5f5a2..265279124f 100644 --- a/spec/api-native-theme-spec.ts +++ b/spec/api-native-theme-spec.ts @@ -4,9 +4,9 @@ import * as os from 'os'; import * as path from 'path'; import * as semver from 'semver'; -import { delay, ifdescribe } from './spec-helpers'; -import { emittedOnce } from './events-helpers'; -import { closeAllWindows } from './window-helpers'; +import { delay, ifdescribe } from './lib/spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { closeAllWindows } from './lib/window-helpers'; describe('nativeTheme module', () => { describe('nativeTheme.shouldUseDarkColors', () => { diff --git a/spec/api-net-log-spec.ts b/spec/api-net-log-spec.ts index f7fed76843..2a8dae45d2 100644 --- a/spec/api-net-log-spec.ts +++ b/spec/api-net-log-spec.ts @@ -6,8 +6,8 @@ import * as path from 'path'; import * as ChildProcess from 'child_process'; import { session, net } from 'electron/main'; import { Socket, AddressInfo } from 'net'; -import { ifit } from './spec-helpers'; -import { emittedOnce } from './events-helpers'; +import { ifit } from './lib/spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; const appPath = path.join(__dirname, 'fixtures', 'api', 'net-log'); const dumpFile = path.join(os.tmpdir(), 'net_log.json'); diff --git a/spec/api-net-spec.ts b/spec/api-net-spec.ts index 7e23afe2e8..d8c42f9a1e 100644 --- a/spec/api-net-spec.ts +++ b/spec/api-net-spec.ts @@ -4,8 +4,8 @@ import { net, session, ClientRequest, BrowserWindow, ClientRequestConstructorOpt import * as http from 'http'; import * as url from 'url'; import { AddressInfo, Socket } from 'net'; -import { emittedOnce } from './events-helpers'; -import { defer, delay } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { defer, delay } from './lib/spec-helpers'; // See https://github.com/nodejs/node/issues/40702. dns.setDefaultResultOrder('ipv4first'); diff --git a/spec/api-notification-dbus-spec.ts b/spec/api-notification-dbus-spec.ts index 9e56a1729b..81ba4f62cc 100644 --- a/spec/api-notification-dbus-spec.ts +++ b/spec/api-notification-dbus-spec.ts @@ -9,7 +9,7 @@ import { expect } from 'chai'; import * as dbus from 'dbus-native'; import { app } from 'electron/main'; -import { ifdescribe } from './spec-helpers'; +import { ifdescribe } from './lib/spec-helpers'; import { promisify } from 'util'; const skip = process.platform !== 'linux' || diff --git a/spec/api-notification-spec.ts b/spec/api-notification-spec.ts index c4c96ae5c4..c94ee3ab38 100644 --- a/spec/api-notification-spec.ts +++ b/spec/api-notification-spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { Notification } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { ifit } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { ifit } from './lib/spec-helpers'; describe('Notification module', () => { it('is supported', () => { diff --git a/spec/api-power-monitor-spec.ts b/spec/api-power-monitor-spec.ts index 1867e8f97b..6a6337fdde 100644 --- a/spec/api-power-monitor-spec.ts +++ b/spec/api-power-monitor-spec.ts @@ -8,7 +8,7 @@ // python-dbusmock. import { expect } from 'chai'; import * as dbus from 'dbus-native'; -import { ifdescribe, delay } from './spec-helpers'; +import { ifdescribe, delay } from './lib/spec-helpers'; import { promisify } from 'util'; describe('powerMonitor', () => { diff --git a/spec/api-process-spec.ts b/spec/api-process-spec.ts index 163839349d..a515e49736 100644 --- a/spec/api-process-spec.ts +++ b/spec/api-process-spec.ts @@ -2,9 +2,9 @@ import * as fs from 'fs'; import * as path from 'path'; import { expect } from 'chai'; import { BrowserWindow } from 'electron'; -import { defer, ifdescribe } from './spec-helpers'; +import { defer, ifdescribe } from './lib/spec-helpers'; import { app } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; +import { closeAllWindows } from './lib/window-helpers'; describe('process module', () => { describe('renderer process', () => { diff --git a/spec/api-protocol-spec.ts b/spec/api-protocol-spec.ts index d97a61961a..0220a67918 100644 --- a/spec/api-protocol-spec.ts +++ b/spec/api-protocol-spec.ts @@ -9,10 +9,10 @@ import * as fs from 'fs'; import * as qs from 'querystring'; import * as stream from 'stream'; import { EventEmitter } from 'events'; -import { closeAllWindows, closeWindow } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { WebmGenerator } from './video-helpers'; -import { delay } from './spec-helpers'; +import { closeAllWindows, closeWindow } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { WebmGenerator } from './lib/video-helpers'; +import { delay } from './lib/spec-helpers'; const fixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-safe-storage-spec.ts b/spec/api-safe-storage-spec.ts index e7f4dcf185..59e7c19cdd 100644 --- a/spec/api-safe-storage-spec.ts +++ b/spec/api-safe-storage-spec.ts @@ -2,8 +2,8 @@ import * as cp from 'child_process'; import * as path from 'path'; import { safeStorage } from 'electron/main'; import { expect } from 'chai'; -import { emittedOnce } from './events-helpers'; -import { ifdescribe } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { ifdescribe } from './lib/spec-helpers'; import * as fs from 'fs-extra'; /* isEncryptionAvailable returns false in Linux when running CI due to a mocked dbus. This stops diff --git a/spec/api-service-workers-spec.ts b/spec/api-service-workers-spec.ts index 9df6714cfa..1f7ec5e510 100644 --- a/spec/api-service-workers-spec.ts +++ b/spec/api-service-workers-spec.ts @@ -5,7 +5,7 @@ import { session, webContents, WebContents } from 'electron/main'; import { expect } from 'chai'; import { v4 } from 'uuid'; import { AddressInfo } from 'net'; -import { emittedOnce, emittedNTimes } from './events-helpers'; +import { emittedOnce, emittedNTimes } from './lib/events-helpers'; const partition = 'service-workers-spec'; diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 886f8ed72e..4a85649485 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -7,9 +7,9 @@ import * as ChildProcess from 'child_process'; import { app, session, BrowserWindow, net, ipcMain, Session, webFrameMain, WebFrameMain } from 'electron/main'; import * as send from 'send'; import * as auth from 'basic-auth'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { defer, delay } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { defer, delay } from './lib/spec-helpers'; import { AddressInfo } from 'net'; /* The whole session API doesn't use standard callbacks */ diff --git a/spec/api-shell-spec.ts b/spec/api-shell-spec.ts index b30af2d62e..69da8f9dfd 100644 --- a/spec/api-shell-spec.ts +++ b/spec/api-shell-spec.ts @@ -1,8 +1,8 @@ import { BrowserWindow, app } from 'electron/main'; import { shell } from 'electron/common'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { ifdescribe, ifit } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; import * as http from 'http'; import * as fs from 'fs-extra'; import * as os from 'os'; diff --git a/spec/api-subframe-spec.ts b/spec/api-subframe-spec.ts index 7eeb775e5b..fb02ea2f39 100644 --- a/spec/api-subframe-spec.ts +++ b/spec/api-subframe-spec.ts @@ -1,11 +1,11 @@ import { expect } from 'chai'; import * as path from 'path'; import * as http from 'http'; -import { emittedNTimes, emittedOnce } from './events-helpers'; -import { closeWindow } from './window-helpers'; +import { emittedNTimes, emittedOnce } from './lib/events-helpers'; +import { closeWindow } from './lib/window-helpers'; import { app, BrowserWindow, ipcMain } from 'electron/main'; import { AddressInfo } from 'net'; -import { ifdescribe } from './spec-helpers'; +import { ifdescribe } from './lib/spec-helpers'; describe('renderer nodeIntegrationInSubFrames', () => { const generateTests = (description: string, webPreferences: any) => { diff --git a/spec/api-system-preferences-spec.ts b/spec/api-system-preferences-spec.ts index d050e40d81..7d12bdb4ed 100644 --- a/spec/api-system-preferences-spec.ts +++ b/spec/api-system-preferences-spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { systemPreferences } from 'electron/main'; -import { ifdescribe } from './spec-helpers'; +import { ifdescribe } from './lib/spec-helpers'; describe('systemPreferences module', () => { ifdescribe(process.platform === 'win32')('systemPreferences.getAccentColor', () => { diff --git a/spec/api-touch-bar-spec.ts b/spec/api-touch-bar-spec.ts index 40980820e7..7c26b81344 100644 --- a/spec/api-touch-bar-spec.ts +++ b/spec/api-touch-bar-spec.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import { BrowserWindow, TouchBar } from 'electron/main'; -import { closeWindow } from './window-helpers'; +import { closeWindow } from './lib/window-helpers'; import { expect } from 'chai'; const { TouchBarButton, TouchBarColorPicker, TouchBarGroup, TouchBarLabel, TouchBarOtherItemsProxy, TouchBarPopover, TouchBarScrubber, TouchBarSegmentedControl, TouchBarSlider, TouchBarSpacer } = TouchBar; diff --git a/spec/api-tray-spec.ts b/spec/api-tray-spec.ts index 1cabcee428..e346533765 100644 --- a/spec/api-tray-spec.ts +++ b/spec/api-tray-spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { Menu, Tray } from 'electron/main'; import { nativeImage } from 'electron/common'; -import { ifdescribe, ifit } from './spec-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; import * as path from 'path'; describe('tray module', () => { diff --git a/spec/api-utility-process-spec.ts b/spec/api-utility-process-spec.ts index bbdab8eea8..9d072b31f5 100644 --- a/spec/api-utility-process-spec.ts +++ b/spec/api-utility-process-spec.ts @@ -2,9 +2,9 @@ import { expect } from 'chai'; import * as childProcess from 'child_process'; import * as path from 'path'; import { BrowserWindow, MessageChannelMain, utilityProcess } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { ifit } from './spec-helpers'; -import { closeWindow } from './window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { ifit } from './lib/spec-helpers'; +import { closeWindow } from './lib/window-helpers'; const fixturesPath = path.resolve(__dirname, 'fixtures', 'api', 'utility-process'); const isWindowsOnArm = process.platform === 'win32' && process.arch === 'arm64'; diff --git a/spec/api-view-spec.ts b/spec/api-view-spec.ts index 5d23eea23b..ada81800ea 100644 --- a/spec/api-view-spec.ts +++ b/spec/api-view-spec.ts @@ -1,4 +1,4 @@ -import { closeWindow } from './window-helpers'; +import { closeWindow } from './lib/window-helpers'; import { BaseWindow, View } from 'electron/main'; describe('View', () => { diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 66626be965..e2a1ec039b 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -4,9 +4,9 @@ import * as path from 'path'; import * as fs from 'fs'; import * as http from 'http'; import { BrowserWindow, ipcMain, webContents, session, WebContents, app, BrowserView } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { closeAllWindows } from './window-helpers'; -import { ifdescribe, delay, defer, waitUntil } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { ifdescribe, delay, defer, waitUntil } from './lib/spec-helpers'; const pdfjs = require('pdfjs-dist'); const fixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-web-contents-view-spec.ts b/spec/api-web-contents-view-spec.ts index b8b7b26030..5fe8f849a7 100644 --- a/spec/api-web-contents-view-spec.ts +++ b/spec/api-web-contents-view-spec.ts @@ -1,4 +1,4 @@ -import { closeWindow } from './window-helpers'; +import { closeWindow } from './lib/window-helpers'; import { BaseWindow, WebContentsView } from 'electron/main'; diff --git a/spec/api-web-frame-main-spec.ts b/spec/api-web-frame-main-spec.ts index 414fc2f721..3843302ff4 100644 --- a/spec/api-web-frame-main-spec.ts +++ b/spec/api-web-frame-main-spec.ts @@ -3,10 +3,10 @@ import * as http from 'http'; import * as path from 'path'; import * as url from 'url'; import { BrowserWindow, WebFrameMain, webFrameMain, ipcMain, app, WebContents } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce, emittedNTimes } from './events-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce, emittedNTimes } from './lib/events-helpers'; import { AddressInfo } from 'net'; -import { defer, ifit, waitUntil } from './spec-helpers'; +import { defer, ifit, waitUntil } from './lib/spec-helpers'; describe('webFrameMain module', () => { const fixtures = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-web-frame-spec.ts b/spec/api-web-frame-spec.ts index f0a6f5a917..3e218204af 100644 --- a/spec/api-web-frame-spec.ts +++ b/spec/api-web-frame-spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; import * as path from 'path'; import { BrowserWindow, ipcMain, WebContents } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { defer } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { defer } from './lib/spec-helpers'; describe('webFrame module', () => { const fixtures = path.resolve(__dirname, 'fixtures'); diff --git a/spec/api-web-request-spec.ts b/spec/api-web-request-spec.ts index 734740b271..d70635759e 100644 --- a/spec/api-web-request-spec.ts +++ b/spec/api-web-request-spec.ts @@ -6,7 +6,7 @@ import * as url from 'url'; import * as WebSocket from 'ws'; import { ipcMain, protocol, session, WebContents, webContents } from 'electron/main'; import { AddressInfo, Socket } from 'net'; -import { emittedOnce } from './events-helpers'; +import { emittedOnce } from './lib/events-helpers'; const fixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/asar-spec.ts b/spec/asar-spec.ts index d835011c69..270b46775b 100644 --- a/spec/asar-spec.ts +++ b/spec/asar-spec.ts @@ -3,9 +3,9 @@ import * as path from 'path'; import * as url from 'url'; import { Worker } from 'worker_threads'; import { BrowserWindow, ipcMain } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { getRemoteContext, ifdescribe, itremote, useRemoteContext } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { getRemoteContext, ifdescribe, itremote, useRemoteContext } from './lib/spec-helpers'; import * as importedFs from 'fs'; const features = process._linkedBinding('electron_common_features'); diff --git a/spec/autofill-spec.ts b/spec/autofill-spec.ts index 4917780965..ebe57ba446 100644 --- a/spec/autofill-spec.ts +++ b/spec/autofill-spec.ts @@ -1,8 +1,8 @@ import { BrowserWindow } from 'electron'; import * as path from 'path'; -import { delay } from './spec-helpers'; +import { delay } from './lib/spec-helpers'; import { expect } from 'chai'; -import { closeAllWindows } from './window-helpers'; +import { closeAllWindows } from './lib/window-helpers'; const fixturesPath = path.resolve(__dirname, 'fixtures'); diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index a856f9bbdc..5719388afd 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { BrowserWindow, WebContents, webFrameMain, session, ipcMain, app, protocol, webContents } from 'electron/main'; -import { emittedOnce } from './events-helpers'; -import { closeAllWindows } from './window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { closeAllWindows } from './lib/window-helpers'; import * as https from 'https'; import * as http from 'http'; import * as path from 'path'; @@ -10,7 +10,7 @@ import * as url from 'url'; import * as ChildProcess from 'child_process'; import { EventEmitter } from 'events'; import { promisify } from 'util'; -import { ifit, ifdescribe, defer, delay, itremote } from './spec-helpers'; +import { ifit, ifdescribe, defer, delay, itremote } from './lib/spec-helpers'; import { AddressInfo } from 'net'; import { PipeTransport } from './pipe-transport'; import * as ws from 'ws'; diff --git a/spec/crash-spec.ts b/spec/crash-spec.ts index dae3c75cec..5cb9e64f5a 100644 --- a/spec/crash-spec.ts +++ b/spec/crash-spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import * as cp from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; -import { ifit } from './spec-helpers'; +import { ifit } from './lib/spec-helpers'; const fixturePath = path.resolve(__dirname, 'fixtures', 'crash-cases'); diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 9819b05ddb..13843a44aa 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -1,13 +1,13 @@ import { expect } from 'chai'; import { app, session, BrowserWindow, ipcMain, WebContents, Extension, Session } from 'electron/main'; -import { closeAllWindows, closeWindow } from './window-helpers'; +import { closeAllWindows, closeWindow } from './lib/window-helpers'; import * as http from 'http'; import { AddressInfo } from 'net'; import * as path from 'path'; import * as fs from 'fs'; import * as WebSocket from 'ws'; -import { emittedOnce, emittedNTimes, emittedUntil } from './events-helpers'; -import { ifit } from './spec-helpers'; +import { emittedOnce, emittedNTimes, emittedUntil } from './lib/events-helpers'; +import { ifit } from './lib/spec-helpers'; const uuid = require('uuid'); diff --git a/spec/guest-window-manager-spec.ts b/spec/guest-window-manager-spec.ts index d3d8f2b626..2e96f32e1a 100644 --- a/spec/guest-window-manager-spec.ts +++ b/spec/guest-window-manager-spec.ts @@ -1,7 +1,7 @@ import { BrowserWindow } from 'electron'; import { expect, assert } from 'chai'; -import { closeAllWindows } from './window-helpers'; -const { emittedOnce } = require('./events-helpers'); +import { closeAllWindows } from './lib/window-helpers'; +const { emittedOnce } = require('./lib/events-helpers'); describe('webContents.setWindowOpenHandler', () => { let browserWindow: BrowserWindow; diff --git a/spec/index.js b/spec/index.js index e266dff45d..b754573a75 100644 --- a/spec/index.js +++ b/spec/index.js @@ -68,7 +68,7 @@ app.whenReady().then(async () => { // 1. test completes, // 2. `defer()`-ed methods run, in reverse order, // 3. regular `afterEach` hooks run. - const { runCleanupFunctions } = require('./spec-helpers'); + const { runCleanupFunctions } = require('./lib/spec-helpers'); mocha.suite.on('suite', function attach (suite) { suite.afterEach('cleanup', runCleanupFunctions); suite.on('suite', attach); diff --git a/spec/events-helpers.ts b/spec/lib/events-helpers.ts similarity index 100% rename from spec/events-helpers.ts rename to spec/lib/events-helpers.ts diff --git a/spec/screen-helpers.ts b/spec/lib/screen-helpers.ts similarity index 98% rename from spec/screen-helpers.ts rename to spec/lib/screen-helpers.ts index 0346b58a6a..c641b6a49c 100644 --- a/spec/screen-helpers.ts +++ b/spec/lib/screen-helpers.ts @@ -2,7 +2,7 @@ import * as path from 'path'; import * as fs from 'fs'; import { screen, desktopCapturer, NativeImage } from 'electron'; -const fixtures = path.resolve(__dirname, 'fixtures'); +const fixtures = path.resolve(__dirname, '..', 'fixtures'); export enum HexColors { GREEN = '#00b140', diff --git a/spec/spec-helpers.ts b/spec/lib/spec-helpers.ts similarity index 98% rename from spec/spec-helpers.ts rename to spec/lib/spec-helpers.ts index 99254ba585..267e91a30e 100644 --- a/spec/spec-helpers.ts +++ b/spec/lib/spec-helpers.ts @@ -72,7 +72,7 @@ class RemoteControlApp { } export async function startRemoteControlApp (extraArgs: string[] = [], options?: childProcess.SpawnOptionsWithoutStdio) { - const appPath = path.join(__dirname, 'fixtures', 'apps', 'remote-control'); + const appPath = path.join(__dirname, '..', 'fixtures', 'apps', 'remote-control'); const appProcess = childProcess.spawn(process.execPath, [appPath, ...extraArgs], options); appProcess.stderr.on('data', d => { process.stderr.write(d); diff --git a/spec/video-helpers.js b/spec/lib/video-helpers.js similarity index 100% rename from spec/video-helpers.js rename to spec/lib/video-helpers.js diff --git a/spec/window-helpers.ts b/spec/lib/window-helpers.ts similarity index 100% rename from spec/window-helpers.ts rename to spec/lib/window-helpers.ts diff --git a/spec/logging-spec.ts b/spec/logging-spec.ts index a98ed4b953..f0b9b80bdc 100644 --- a/spec/logging-spec.ts +++ b/spec/logging-spec.ts @@ -1,7 +1,7 @@ import { app } from 'electron'; import { expect } from 'chai'; -import { emittedOnce } from './events-helpers'; -import { startRemoteControlApp, ifdescribe } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { startRemoteControlApp, ifdescribe } from './lib/spec-helpers'; import * as fs from 'fs/promises'; import * as path from 'path'; diff --git a/spec/modules-spec.ts b/spec/modules-spec.ts index 77d32b84fb..fbf71c5f98 100644 --- a/spec/modules-spec.ts +++ b/spec/modules-spec.ts @@ -2,9 +2,9 @@ import { expect } from 'chai'; import * as path from 'path'; import * as fs from 'fs'; import { BrowserWindow } from 'electron/main'; -import { ifdescribe, ifit } from './spec-helpers'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce } from './events-helpers'; +import { ifdescribe, ifit } from './lib/spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; import * as childProcess from 'child_process'; const Module = require('module'); diff --git a/spec/node-spec.ts b/spec/node-spec.ts index 1eced8ab1d..035a2923ea 100644 --- a/spec/node-spec.ts +++ b/spec/node-spec.ts @@ -3,8 +3,8 @@ import * as childProcess from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; import * as util from 'util'; -import { emittedOnce } from './events-helpers'; -import { getRemoteContext, ifdescribe, ifit, itremote, useRemoteContext } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { getRemoteContext, ifdescribe, ifit, itremote, useRemoteContext } from './lib/spec-helpers'; import { webContents, WebContents } from 'electron/main'; import { EventEmitter } from 'stream'; diff --git a/spec/security-warnings-spec.ts b/spec/security-warnings-spec.ts index 3f279ab770..848bdf91e7 100644 --- a/spec/security-warnings-spec.ts +++ b/spec/security-warnings-spec.ts @@ -6,10 +6,10 @@ import * as url from 'url'; import { BrowserWindow, WebPreferences } from 'electron/main'; -import { closeWindow } from './window-helpers'; +import { closeWindow } from './lib/window-helpers'; import { AddressInfo } from 'net'; -import { emittedUntil } from './events-helpers'; -import { delay } from './spec-helpers'; +import { emittedUntil } from './lib/events-helpers'; +import { delay } from './lib/spec-helpers'; const messageContainsSecurityWarning = (event: Event, level: number, message: string) => { return message.indexOf('Electron Security Warning') > -1; diff --git a/spec/spellchecker-spec.ts b/spec/spellchecker-spec.ts index fcd0042f3f..87f0513b96 100644 --- a/spec/spellchecker-spec.ts +++ b/spec/spellchecker-spec.ts @@ -5,9 +5,9 @@ import * as path from 'path'; import * as fs from 'fs'; import * as http from 'http'; import { AddressInfo } from 'net'; -import { closeWindow } from './window-helpers'; -import { emittedOnce } from './events-helpers'; -import { ifit, ifdescribe, delay } from './spec-helpers'; +import { closeWindow } from './lib/window-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { ifit, ifdescribe, delay } from './lib/spec-helpers'; const features = process._linkedBinding('electron_common_features'); const v8Util = process._linkedBinding('electron_common_v8_util'); diff --git a/spec/version-bump-spec.ts b/spec/version-bump-spec.ts index 8c561deaa2..8f38bf896a 100644 --- a/spec/version-bump-spec.ts +++ b/spec/version-bump-spec.ts @@ -3,7 +3,7 @@ import { GitProcess, IGitExecutionOptions, IGitResult } from 'dugite'; import { nextVersion } from '../script/release/version-bumper'; import * as utils from '../script/release/version-utils'; import * as sinon from 'sinon'; -import { ifdescribe } from './spec-helpers'; +import { ifdescribe } from './lib/spec-helpers'; class GitFake { branches: { diff --git a/spec/visibility-state-spec.ts b/spec/visibility-state-spec.ts index fc0b692aa2..89df7225e1 100644 --- a/spec/visibility-state-spec.ts +++ b/spec/visibility-state-spec.ts @@ -3,9 +3,9 @@ import * as cp from 'child_process'; import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron/main'; import * as path from 'path'; -import { emittedOnce } from './events-helpers'; -import { closeWindow } from './window-helpers'; -import { ifdescribe, delay } from './spec-helpers'; +import { emittedOnce } from './lib/events-helpers'; +import { closeWindow } from './lib/window-helpers'; +import { ifdescribe, delay } from './lib/spec-helpers'; // visibilityState specs pass on linux with a real window manager but on CI // the environment does not let these specs pass diff --git a/spec/webview-spec.ts b/spec/webview-spec.ts index 2a30247057..bd6cdb280d 100644 --- a/spec/webview-spec.ts +++ b/spec/webview-spec.ts @@ -1,9 +1,9 @@ import * as path from 'path'; import * as url from 'url'; import { BrowserWindow, session, ipcMain, app, WebContents } from 'electron/main'; -import { closeAllWindows } from './window-helpers'; -import { emittedOnce, emittedUntil } from './events-helpers'; -import { ifit, ifdescribe, delay, defer, itremote, useRemoteContext } from './spec-helpers'; +import { closeAllWindows } from './lib/window-helpers'; +import { emittedOnce, emittedUntil } from './lib/events-helpers'; +import { ifit, ifdescribe, delay, defer, itremote, useRemoteContext } from './lib/spec-helpers'; import { expect } from 'chai'; import * as http from 'http'; import { AddressInfo } from 'net';