aboutsummaryrefslogtreecommitdiff
path: root/__tests__/index.js
diff options
context:
space:
mode:
Diffstat (limited to '__tests__/index.js')
-rw-r--r--__tests__/index.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/__tests__/index.js b/__tests__/index.js
index 56158bb..1be433c 100644
--- a/__tests__/index.js
+++ b/__tests__/index.js
@@ -546,3 +546,17 @@ test('defaultValue name', t => {
t.is(r.eaten, 'visible');
});
+test('braces in attr', t => {
+ const toParse = `{ data-json='{"a": 1, "b": 2}' }`;
+ const r = parse(toParse);
+ t.is(r.prop['data-json'], '{"a": 1, "b": 2}');
+ t.is(r.eaten, toParse);
+});
+
+test('nested braces in attr', t => {
+ const toParse = `{ data-json='{"a": 1, "b": { "c": 4 }}' }`;
+ const r = parse(toParse);
+ t.is(r.prop['data-json'], '{"a": 1, "b": { "c": 4 }}');
+ t.is(r.eaten, toParse);
+});
+