Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: rename & split internal module tests #37328

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions 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' });
});
});
20 changes: 0 additions & 20 deletions spec/internal-spec.ts → spec/process-binding-spec.ts
Expand Up @@ -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', () => {
Expand Down
1 change: 0 additions & 1 deletion typings/internal-electron.d.ts
Expand Up @@ -251,7 +251,6 @@ declare namespace ElectronInternal {

interface ModuleEntry {
name: string;
private?: boolean;
loader: ModuleLoader;
}

Expand Down