提交 a15e34f7 编写于 作者: M Martin Aeschlimann

test jsonEdit with null (for #20714)

上级 c96fbaec
......@@ -42,6 +42,9 @@ suite('JSON - edits', () => {
content = '{\n "x": "y"\n}';
edits = setProperty(content, ['x'], { key: true }, formatterOptions);
assertEdit(content, edits, '{\n "x": {\n "key": true\n }\n}');
content = '{\n "a": "b", "x": "y"\n}';
edits = setProperty(content, ['a'], null, formatterOptions);
assertEdit(content, edits, '{\n "a": null, "x": "y"\n}');
});
test('insert property', () => {
......@@ -64,6 +67,10 @@ suite('JSON - edits', () => {
edits = setProperty(content, ['foo'], 'bar', formatterOptions);
assertEdit(content, edits, '{\n "x": "y",\n "foo": "bar"\n}');
content = '{\n "x": "y"\n}';
edits = setProperty(content, ['e'], 'null', formatterOptions);
assertEdit(content, edits, '{\n "x": "y",\n "e": "null"\n}');
edits = setProperty(content, ['x'], 'bar', formatterOptions);
assertEdit(content, edits, '{\n "x": "bar"\n}');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册