Skip to content

Commit 443ae73

Browse files
committed
chore: fix test cases following prefix change to '$'
1 parent dc34e74 commit 443ae73

File tree

4 files changed

+54
-54
lines changed

4 files changed

+54
-54
lines changed

src/__tests__/arrayModeSpec.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ describe('XMLParser with arrayMode enabled', () => {
3939
{
4040
item: [
4141
{
42-
'@_grade': 'A',
42+
$grade: 'A',
4343
name: 'Banana',
4444
count: 200,
4545
},
4646
{
47-
'@_grade': 'B',
47+
$grade: 'B',
4848
name: 'Apple',
4949
count: 100,
5050
},
@@ -114,12 +114,12 @@ describe('XMLParser with arrayMode enabled', () => {
114114
{
115115
item: [
116116
{
117-
'@_grade': ['A'],
117+
$grade: ['A'],
118118
name: ['Banana'],
119119
count: [200],
120120
},
121121
{
122-
'@_grade': ['B'],
122+
$grade: ['B'],
123123
name: ['Apple'],
124124
count: [100],
125125
},
@@ -188,12 +188,12 @@ describe('XMLParser with arrayMode enabled', () => {
188188
{
189189
item: [
190190
{
191-
'@_grade': 'A',
191+
$grade: 'A',
192192
name: 'Banana',
193193
count: 200,
194194
},
195195
{
196-
'@_grade': 'B',
196+
$grade: 'B',
197197
name: 'Apple',
198198
count: 100,
199199
},
@@ -267,12 +267,12 @@ describe('XMLParser with arrayMode enabled', () => {
267267
inventory: {
268268
item: [
269269
{
270-
'@_grade': 'A',
270+
$grade: 'A',
271271
name: 'Banana',
272272
count: 200,
273273
},
274274
{
275-
'@_grade': 'B',
275+
$grade: 'B',
276276
name: 'Apple',
277277
count: 100,
278278
},

src/__tests__/cdataSpec.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ patronymic</person></root>`);
6363
'sql-queries': {
6464
'sql-query': [
6565
{
66-
'@_id': 'testquery',
66+
'$id': 'testquery',
6767
'#text': 'select * from search_urls',
6868
},
6969
{
70-
'@_id': 'searchinfo',
70+
'$id': 'searchinfo',
7171
'#text': 'select * from search_urls where search_urls=?',
7272
},
7373
{
74-
'@_id': 'searchurls',
74+
'$id': 'searchurls',
7575
'#text': 'select search_url from search_urls ',
7676
},
7777
],
@@ -247,13 +247,13 @@ patronymic</person></root>`);
247247
ptag: [
248248
{
249249
nestedtag: 'nesteddata',
250-
'@_attr': 'val',
251-
'@_boolean': true,
250+
'$attr': 'val',
251+
'$boolean': true,
252252
'#text': 'some dataafter',
253253
},
254254
'before text\n <nestedtag>\n nested cdata 1<!--single line comment-->\n </nestedtag>\n middle\n <nestedtag>\n nested cdata 2<!--multi line\n comment-->\n </nestedtag>\n after\n <nestedtag>\n nested cdata 3\n </nestedtag>\n end',
255255
],
256-
'@_xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
256+
'$xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
257257
},
258258
};
259259

src/__tests__/data.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ describe('XMLParser', () => {
4646
'#text': 'as well',
4747
bug: {
4848
'#text': 'valhere',
49-
'@_atr': 'sasa',
50-
'@_boolean': true,
49+
$atr: 'sasa',
50+
$boolean: true,
5151
b: '',
5252
br: [
5353
'',
5454
{
55-
'@_b': true,
55+
$b: true,
5656
},
5757
],
5858
c: 'some',
@@ -86,11 +86,11 @@ describe('XMLParser', () => {
8686
</a:root>`);
8787
const expected = {
8888
'a:root': {
89-
'@_xmlns:a': 'urn:none',
90-
'@_xmlns:a-b': 'urn:none',
89+
'$xmlns:a': 'urn:none',
90+
'$xmlns:a-b': 'urn:none',
9191
'a:a': {
9292
'#text': 1,
93-
'@_attr': '2foo&ampbar&apos;',
93+
$attr: '2foo&ampbar&apos;',
9494
},
9595
'a:b': 2,
9696
'a-b:b-a': 2,
@@ -99,7 +99,7 @@ describe('XMLParser', () => {
9999
'c:string': {
100100
'#text':
101101
'&#x441;&#x442;&#x440;&#x430;&#x445;&#x43e;&#x432;&#x430;&#x43d;&#x438;&#x44f; » &#x43e;&#x442; &#x441;&#x443;&#x43c;&#x43c;&#x44b; &#x435;&#x433;&#x43e; &#x430;&#x43a;&#x442;&#x438;&#x432;&#x43e;&#x432;',
102-
'@_lang': 'ru',
102+
$lang: 'ru',
103103
},
104104
},
105105
};
@@ -120,7 +120,7 @@ describe('XMLParser', () => {
120120

121121
const expected = {
122122
'a:root': {
123-
'@_attr': 'df',
123+
$attr: 'df',
124124
'#text': 'val',
125125
},
126126
};
@@ -181,8 +181,8 @@ describe('XMLParser', () => {
181181
b: 'c',
182182
d: '',
183183
e: {
184-
'@_atr': 'sasa',
185-
'@_boolean': true,
184+
$atr: 'sasa',
185+
$boolean: true,
186186
},
187187
};
188188

src/__tests__/xmlParser.test.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('XMLParser', () => {
168168
floatTag1: 1,
169169
floatTag2: 2,
170170
floatTag3: {
171-
'@_float': 3,
171+
$float: 3,
172172
},
173173
},
174174
};
@@ -207,10 +207,10 @@ describe('XMLParser', () => {
207207
rootNode: {
208208
tag: {
209209
'#text': 'value',
210-
'@_int': 45,
211-
'@_intNegative': -45,
212-
'@_float': 65.34,
213-
'@_floatNegative': -65.34,
210+
$int: 45,
211+
$intNegative: -45,
212+
$float: 65.34,
213+
$floatNegative: -65.34,
214214
},
215215
},
216216
};
@@ -271,17 +271,17 @@ describe('XMLParser', () => {
271271
const expected = {
272272
node: {
273273
tag: {
274-
'@_arg': 'value',
274+
$arg: 'value',
275275
'#text': 'value',
276276
},
277277
intTag: {
278-
'@_arg': 'value',
279-
'@_arg2': 'value2',
278+
$arg: 'value',
279+
$arg2: 'value2',
280280
'#text': 45,
281281
},
282282
floatTag: 65.34,
283283
nsTag: {
284-
'@_attr': 'tns',
284+
$attr: 'tns',
285285
//"#text": ""
286286
},
287287
nsTagNoAttr: '',
@@ -314,7 +314,7 @@ describe('XMLParser', () => {
314314
const expected = {
315315
rootNode: {
316316
tag: {
317-
'@_ns:arg': 'value',
317+
'$ns:arg': 'value',
318318
},
319319
},
320320
};
@@ -327,7 +327,7 @@ describe('XMLParser', () => {
327327
const xmlData = encoder.encode(`<tag arg='value'/>`);
328328
const expected = {
329329
tag: {
330-
'@_arg': 'value',
330+
$arg: 'value',
331331
},
332332
};
333333

@@ -392,26 +392,26 @@ describe('XMLParser', () => {
392392
rootNode: {
393393
parenttag: [
394394
{
395-
'@_attr1': 'some val',
396-
'@_attr2': 'another val',
395+
$attr1: 'some val',
396+
$attr2: 'another val',
397397
tag: [
398398
'value',
399399
{
400-
'@_attr1': 'val',
401-
'@_attr2': '234',
400+
$attr1: 'val',
401+
$attr2: '234',
402402
'#text': 45,
403403
},
404404
65.34,
405405
],
406406
},
407407
{
408-
'@_attr1': 'some val',
409-
'@_attr2': 'another val',
408+
$attr1: 'some val',
409+
$attr2: 'another val',
410410
tag: [
411411
'value',
412412
{
413-
'@_attr1': 'val',
414-
'@_attr2': '234',
413+
$attr1: 'val',
414+
$attr2: '234',
415415
'#text': 45,
416416
},
417417
65.34,
@@ -433,8 +433,8 @@ describe('XMLParser', () => {
433433
);
434434
const expected = {
435435
rootNode: {
436-
'@_attr1': ' some val ',
437-
'@_name': 'another val',
436+
$attr1: ' some val ',
437+
$name: 'another val',
438438
'#text': ' some val ',
439439
},
440440
};
@@ -451,8 +451,8 @@ describe('XMLParser', () => {
451451
);
452452
const expected = {
453453
rootNode: {
454-
'@_attr1': 'some val',
455-
'@_attr2': 'another val',
454+
$attr1: 'some val',
455+
$attr2: 'another val',
456456
'#text': 'val',
457457
},
458458
};
@@ -504,15 +504,15 @@ describe('XMLParser', () => {
504504
const expected = {
505505
root: {
506506
Meet: {
507-
'@_date': '2017-05-03',
508-
'@_type': 'A',
509-
'@_name': "Meeting 'A'",
507+
$date: '2017-05-03',
508+
$type: 'A',
509+
$name: "Meeting 'A'",
510510
Event: {
511-
'@_time': '00:05:00',
512-
'@_ID': '574',
513-
'@_Name': 'Some Event Name',
511+
$time: '00:05:00',
512+
$ID: '574',
513+
$Name: 'Some Event Name',
514514
User: {
515-
'@_ID': '1',
515+
$ID: '1',
516516
'#text': 'Bob',
517517
},
518518
},

0 commit comments

Comments
 (0)