refactor: move spec helpers to spec/lib (#37010)

Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
Milan Burda 2023-01-25 22:01:25 +01:00 коммит произвёл GitHub
Родитель 355f322dbd
Коммит 4bc6b15f53
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
63 изменённых файлов: 125 добавлений и 125 удалений

Просмотреть файл

@ -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');

Просмотреть файл

@ -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 () {

Просмотреть файл

@ -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';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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.

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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');

Просмотреть файл

@ -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';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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(() => {

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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');

Просмотреть файл

@ -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';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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');

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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' ||

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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');

Просмотреть файл

@ -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

Просмотреть файл

@ -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';

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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';

Просмотреть файл

@ -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) => {

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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', () => {

Просмотреть файл

@ -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';

Просмотреть файл

@ -1,4 +1,4 @@
import { closeWindow } from './window-helpers';
import { closeWindow } from './lib/window-helpers';
import { BaseWindow, View } from 'electron/main';
describe('View', () => {

Просмотреть файл

@ -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');

Просмотреть файл

@ -1,4 +1,4 @@
import { closeWindow } from './window-helpers';
import { closeWindow } from './lib/window-helpers';
import { BaseWindow, WebContentsView } from 'electron/main';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

Просмотреть файл

@ -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',

Просмотреть файл

@ -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);

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -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';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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';

Просмотреть файл

@ -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;

Просмотреть файл

@ -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');

Просмотреть файл

@ -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: {

Просмотреть файл

@ -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

Просмотреть файл

@ -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';