зеркало из https://github.com/electron/electron.git
test: tsify internal-spec (#19962)
This commit is contained in:
Родитель
217ed9aabc
Коммит
41d8247ffc
|
@ -1,12 +1,11 @@
|
|||
const chai = require('chai')
|
||||
const { expect } = chai
|
||||
import { expect } from 'chai'
|
||||
|
||||
describe('feature-string parsing', () => {
|
||||
it('is indifferent to whitespace around keys and values', () => {
|
||||
const parseFeaturesString = require('../lib/common/parse-features-string')
|
||||
const checkParse = (string, parsed) => {
|
||||
const features = {}
|
||||
parseFeaturesString(string, (k, v) => { features[k] = v })
|
||||
const checkParse = (string: string, parsed: Record<string, string | boolean>) => {
|
||||
const features: Record<string, string | boolean> = {}
|
||||
parseFeaturesString(string, (k: string, v: any) => { features[k] = v })
|
||||
expect(features).to.deep.equal(parsed)
|
||||
}
|
||||
checkParse('a=yes,c=d', { a: true, c: 'd' })
|
Загрузка…
Ссылка в новой задаче