From 9e6db160d3b1da7ec0c45502b6d293c3907378ea Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 17 Feb 2023 09:15:13 +0000 Subject: [PATCH] test: rename & split internal module tests Co-authored-by: Milan Burda --- spec/parse-features-string-spec.ts | 21 +++++++++++++++++++ ...ternal-spec.ts => process-binding-spec.ts} | 20 ------------------ typings/internal-electron.d.ts | 1 - 3 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 spec/parse-features-string-spec.ts rename spec/{internal-spec.ts => process-binding-spec.ts} (65%) diff --git a/spec/parse-features-string-spec.ts b/spec/parse-features-string-spec.ts new file mode 100644 index 0000000000000..be561064b5073 --- /dev/null +++ b/spec/parse-features-string-spec.ts @@ -0,0 +1,21 @@ +import { expect } from 'chai'; +import { parseCommaSeparatedKeyValue } from '../lib/browser/parse-features-string'; + +describe('feature-string parsing', () => { + it('is indifferent to whitespace around keys and values', () => { + const checkParse = (string: string, parsed: Record) => { + const features = parseCommaSeparatedKeyValue(string); + expect(features).to.deep.equal(parsed); + }; + checkParse('a=yes,c=d', { a: true, c: 'd' }); + checkParse('a=yes ,c=d', { a: true, c: 'd' }); + checkParse('a=yes, c=d', { a: true, c: 'd' }); + checkParse('a=yes , c=d', { a: true, c: 'd' }); + checkParse(' a=yes , c=d', { a: true, c: 'd' }); + checkParse(' a= yes , c=d', { a: true, c: 'd' }); + checkParse(' a = yes , c=d', { a: true, c: 'd' }); + checkParse(' a = yes , c =d', { a: true, c: 'd' }); + checkParse(' a = yes , c = d', { a: true, c: 'd' }); + checkParse(' a = yes , c = d ', { a: true, c: 'd' }); + }); +}); diff --git a/spec/internal-spec.ts b/spec/process-binding-spec.ts similarity index 65% rename from spec/internal-spec.ts rename to spec/process-binding-spec.ts index 647c67b9e706d..343e7536cbd58 100644 --- a/spec/internal-spec.ts +++ b/spec/process-binding-spec.ts @@ -2,26 +2,6 @@ import { expect } from 'chai'; import { BrowserWindow } from 'electron/main'; import { closeAllWindows } from './lib/window-helpers'; -describe('feature-string parsing', () => { - it('is indifferent to whitespace around keys and values', () => { - const { parseCommaSeparatedKeyValue } = require('../lib/browser/parse-features-string'); - const checkParse = (string: string, parsed: Record) => { - const features = parseCommaSeparatedKeyValue(string); - expect(features).to.deep.equal(parsed); - }; - checkParse('a=yes,c=d', { a: true, c: 'd' }); - checkParse('a=yes ,c=d', { a: true, c: 'd' }); - checkParse('a=yes, c=d', { a: true, c: 'd' }); - checkParse('a=yes , c=d', { a: true, c: 'd' }); - checkParse(' a=yes , c=d', { a: true, c: 'd' }); - checkParse(' a= yes , c=d', { a: true, c: 'd' }); - checkParse(' a = yes , c=d', { a: true, c: 'd' }); - checkParse(' a = yes , c =d', { a: true, c: 'd' }); - checkParse(' a = yes , c = d', { a: true, c: 'd' }); - checkParse(' a = yes , c = d ', { a: true, c: 'd' }); - }); -}); - describe('process._linkedBinding', () => { describe('in the main process', () => { it('can access electron_browser bindings', () => { diff --git a/typings/internal-electron.d.ts b/typings/internal-electron.d.ts index c4c8a7563330c..cb94bbf95a34c 100644 --- a/typings/internal-electron.d.ts +++ b/typings/internal-electron.d.ts @@ -251,7 +251,6 @@ declare namespace ElectronInternal { interface ModuleEntry { name: string; - private?: boolean; loader: ModuleLoader; }