Browse Source

test: rename & split internal module tests (#37328)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <[email protected]>
trop[bot] 2 years ago
parent
commit
f3d50c674c
3 changed files with 21 additions and 21 deletions
  1. 21 0
      spec/parse-features-string-spec.ts
  2. 0 20
      spec/process-binding-spec.ts
  3. 0 1
      typings/internal-electron.d.ts

+ 21 - 0
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<string, string | boolean>) => {
+      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' });
+  });
+});

+ 0 - 20
spec/internal-spec.ts → 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<string, string | boolean>) => {
-      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', () => {

+ 0 - 1
typings/internal-electron.d.ts

@@ -251,7 +251,6 @@ declare namespace ElectronInternal {
 
   interface ModuleEntry {
     name: string;
-    private?: boolean;
     loader: ModuleLoader;
   }