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' });
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue