ba6d9291d2
build: add import/order eslint rule (#44085) * build: add import/order eslint rule * chore: run lint:js --fix
22 lines
975 B
TypeScript
22 lines
975 B
TypeScript
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' });
|
|
});
|
|
});
|