Skip to content

Commit

Permalink
#18095 Json edit
Browse files Browse the repository at this point in the history
- Test to remove last item in the array if there is a comment in the beginning
  • Loading branch information
sandy081 committed Mar 27, 2017
1 parent 9bb8aad commit 919254b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vs/base/test/common/jsonEdit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,16 @@ suite('JSON - edits', () => {
assertEdit(content, edits, '[\n 1,\n 2\n]');
});

test('remove last item in the array if ends with comman', () => {
test('remove last item in the array if ends with comma', () => {
let content = '[\n 1,\n "foo",\n "bar",\n]';
let edits = setProperty(content, [2], void 0, formatterOptions);
assertEdit(content, edits, '[\n 1,\n "foo"\n]');
});

test('remove last item in the array if there is a comment in the beginning', () => {
let content = '// This is a comment\n[\n 1,\n "foo",\n "bar"\n]';
let edits = setProperty(content, [2], void 0, formatterOptions);
assertEdit(content, edits, '// This is a comment\n[\n 1,\n "foo"\n]');
});

});

0 comments on commit 919254b

Please sign in to comment.