test: rename & split internal module tests (#37318)
This commit is contained in:
parent
73b7aac6a4
commit
0a5e634736
3 changed files with 21 additions and 21 deletions
21
spec/parse-features-string-spec.ts
Normal file
21
spec/parse-features-string-spec.ts
Normal file
|
@ -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' });
|
||||||
|
});
|
||||||
|
});
|
|
@ -2,26 +2,6 @@ import { expect } from 'chai';
|
||||||
import { BrowserWindow } from 'electron/main';
|
import { BrowserWindow } from 'electron/main';
|
||||||
import { closeAllWindows } from './lib/window-helpers';
|
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('process._linkedBinding', () => {
|
||||||
describe('in the main process', () => {
|
describe('in the main process', () => {
|
||||||
it('can access electron_browser bindings', () => {
|
it('can access electron_browser bindings', () => {
|
1
typings/internal-electron.d.ts
vendored
1
typings/internal-electron.d.ts
vendored
|
@ -249,7 +249,6 @@ declare namespace ElectronInternal {
|
||||||
|
|
||||||
interface ModuleEntry {
|
interface ModuleEntry {
|
||||||
name: string;
|
name: string;
|
||||||
private?: boolean;
|
|
||||||
loader: ModuleLoader;
|
loader: ModuleLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue