From 919254bcdb4d3b3f6dd84e8f719467e652f8adf7 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 27 Mar 2017 12:44:30 +0200 Subject: [PATCH] #18095 Json edit - Test to remove last item in the array if there is a comment in the beginning --- src/vs/base/test/common/jsonEdit.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/base/test/common/jsonEdit.test.ts b/src/vs/base/test/common/jsonEdit.test.ts index 2b8ea381df2ad..ef9966424488b 100644 --- a/src/vs/base/test/common/jsonEdit.test.ts +++ b/src/vs/base/test/common/jsonEdit.test.ts @@ -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]'); + }); + }); \ No newline at end of file