@@ -13,8 +13,8 @@ var assert = require('assert');
1313var sorter = require ( '../lib/sort-json-core' ) ;
1414var JSON5 = require ( 'json5' ) ;
1515
16- suite ( 'Extension Tests' , function ( ) {
17- test ( 'normal js object asc' , function ( ) {
16+ suite ( 'Extension Tests' , function ( ) {
17+ test ( 'normal js object asc' , function ( ) {
1818 var jsObject = `{
1919 user: 'user',
2020 aaa: 'aaa',
@@ -35,35 +35,7 @@ suite('Extension Tests', function() {
3535 ) ;
3636 } ) ;
3737
38- test ( 'Not js object' , function ( ) {
39- var jsObject = `aaa: 1` ;
40-
41- var result ;
42- try {
43- result = sorter . sort ( jsObject , 4 , JSON5 , [ 'asc' ] , { } ) ;
44- } catch ( e ) {
45- result = e ;
46- }
47-
48- assert . equal ( result , 'Please make sure your selected text is a JS obejct!' ) ;
49- } ) ;
50-
51- test ( 'Not js object 2' , function ( ) {
52- var jsObject = `{test('normal js object desc', function() {
53- var jsObject = '';
54- }` ;
55-
56- var result ;
57- try {
58- result = sorter . sort ( jsObject , 4 , JSON5 , [ 'asc' ] , { } ) ;
59- } catch ( e ) {
60- result = e ;
61- }
62-
63- assert . equal ( result , 'Please make sure your selected text is a JS obejct!' ) ;
64- } ) ;
65-
66- test ( 'normal js object desc' , function ( ) {
38+ test ( 'normal js object desc' , function ( ) {
6739 var jsObject = `{
6840 user: 'user',
6941 aaa: 'aaa',
@@ -84,7 +56,7 @@ suite('Extension Tests', function() {
8456 ) ;
8557 } ) ;
8658
87- test ( 'normal js object indent 2' , function ( ) {
59+ test ( 'normal js object indent 2' , function ( ) {
8860 var jsObject = `{
8961 user: 'user',
9062 aaa: 'aaa',
@@ -105,7 +77,7 @@ suite('Extension Tests', function() {
10577 ) ;
10678 } ) ;
10779
108- test ( 'format js object' , function ( ) {
80+ test ( 'format js object' , function ( ) {
10981 var jsObject = `{
11082 user : 'user',
11183
@@ -127,7 +99,7 @@ suite('Extension Tests', function() {
12799 ) ;
128100 } ) ;
129101
130- test ( 'ES6 feature test' , function ( ) {
102+ test ( 'ES6 feature test' , function ( ) {
131103 var jsObject = `{
132104 user: 'user',
133105 aaa,
@@ -148,7 +120,7 @@ suite('Extension Tests', function() {
148120 ) ;
149121 } ) ;
150122
151- test ( 'Multi lines value test' , function ( ) {
123+ test ( 'Multi lines value test' , function ( ) {
152124 var jsObject = `{
153125 b: new String('b')
154126 .length,
@@ -166,7 +138,7 @@ suite('Extension Tests', function() {
166138 ) ;
167139 } ) ;
168140
169- test ( 'Auto add comma' , function ( ) {
141+ test ( 'Auto add comma' , function ( ) {
170142 var jsObject = `{
171143 b: 'b',
172144 a: 'a',
@@ -183,7 +155,7 @@ suite('Extension Tests', function() {
183155 ) ;
184156 } ) ;
185157
186- test ( 'Support line comments' , function ( ) {
158+ test ( 'Support line comments' , function ( ) {
187159 var jsObject = `{
188160 b: 2,
189161 // some comment
@@ -208,7 +180,7 @@ suite('Extension Tests', function() {
208180 ) ;
209181 } ) ;
210182
211- test ( 'Support line comments for indent 2' , function ( ) {
183+ test ( 'Support line comments for indent 2' , function ( ) {
212184 var jsObject = `{
213185 b: 2,
214186 // some comment
@@ -233,7 +205,7 @@ suite('Extension Tests', function() {
233205 ) ;
234206 } ) ;
235207
236- test ( 'Support line comments at the end of the object' , function ( ) {
208+ test ( 'Support line comments at the end of the object' , function ( ) {
237209 var jsObject = `{
238210 b: 2,
239211 // some comment
@@ -260,7 +232,7 @@ suite('Extension Tests', function() {
260232 ) ;
261233 } ) ;
262234
263- test ( "Support ' in string" , function ( ) {
235+ test ( "Support ' in string" , function ( ) {
264236 var jsObject = `{
265237 b: 'test \\'',
266238 c: 'test \\' test',
@@ -279,7 +251,7 @@ suite('Extension Tests', function() {
279251 ) ;
280252 } ) ;
281253
282- test ( 'Not change " in string ' , function ( ) {
254+ test ( 'Not change " in string ' , function ( ) {
283255 var jsObject = `{
284256 d: "\\" test",
285257 b: 'test " test',
@@ -302,7 +274,7 @@ suite('Extension Tests', function() {
302274 ) ;
303275 } ) ;
304276
305- test ( 'Support ES6 string key' , function ( ) {
277+ test ( 'Support ES6 string key' , function ( ) {
306278 var jsObject = `{
307279 'b': 'test',
308280 a: 1,
@@ -322,4 +294,4 @@ suite('Extension Tests', function() {
322294 }`
323295 ) ;
324296 } ) ;
325- } ) ;
297+ } ) ;
0 commit comments