aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
authorJayson Harshbarger <hypercubed@gmail.com>2018-09-04 13:51:07 -0600
committerJayson Harshbarger <hypercubed@gmail.com>2018-09-04 13:51:07 -0600
commit82aa13e46232caf39ea8b27f554fd6c667b101cd (patch)
treefe31f6d82c9c165162f0505379b3c5c20025b1df /__tests__
parentMerge pull request #3 from Hypercubed/patch-1 (diff)
Fix braces parsing in quotes
Diffstat (limited to '__tests__')
-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);
+});
+