diff options
author | ache <ache@ache.one> | 2018-07-23 09:40:55 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2018-07-23 09:40:55 +0200 |
commit | 9106ddd60e315a7d61ffd3ef9e59bf6ae582387f (patch) | |
tree | 9c5446bc53b8310a10f5de3d167980afd36b8d86 /__tests__ | |
parent | default value config for attributes without value (diff) |
test about default value for attributes without value
Diffstat (limited to '__tests__')
-rw-r--r-- | __tests__/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/__tests__/index.js b/__tests__/index.js index ad7182b..a8e6e15 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -532,3 +532,17 @@ test('alone brace', t => { t.is(r.eaten, ''); // It's an error }); +test('defaultValue true', t => { + const toParse = 'visible'; + const r = parse(toParse, 0, {defaultValue: "true"}); + t.is(r.prop.visible, 'true'); + t.is(r.eaten, 'visible'); +}); + +test('defaultValue name', t => { + const toParse = 'visible'; + const r = parse(toParse, 0, {defaultValue: x => x}); + t.is(r.prop.visible, 'visible'); + t.is(r.eaten, 'visible'); +}); + |