@@ -12,10 +12,11 @@ function resolveFixture(fileName) {
12
12
test ( 'should emit error on streamed file' , async ( ) => {
13
13
const fixture = resolveFixture ( 'valid.xml' ) ;
14
14
15
- const { message } = await new Promise ( resolve => {
16
- gulp . src ( fixture , { buffer : false } )
15
+ const { message } = await new Promise ( ( resolve ) => {
16
+ gulp
17
+ . src ( fixture , { buffer : false } )
17
18
. pipe ( xmlValidator ( ) )
18
- . once ( 'error' , error => resolve ( error ) ) ;
19
+ . once ( 'error' , ( error ) => resolve ( error ) ) ;
19
20
} ) ;
20
21
21
22
assert . is ( message , 'Streaming not supported' ) ;
@@ -24,19 +25,22 @@ test('should emit error on streamed file', async () => {
24
25
test ( 'pass on valid xml' , async ( ) => {
25
26
const fixture = resolveFixture ( 'valid.xml' ) ;
26
27
27
- assert . not . throws ( async ( ) => await new Promise ( ( ) => {
28
- gulp . src ( fixture )
29
- . pipe ( xmlValidator ( ) ) ;
30
- } ) ) ;
28
+ assert . not . throws (
29
+ async ( ) =>
30
+ await new Promise ( ( ) => {
31
+ gulp . src ( fixture ) . pipe ( xmlValidator ( ) ) ;
32
+ } ) ,
33
+ ) ;
31
34
} ) ;
32
35
33
36
test ( 'fail on mismatching tags' , async ( ) => {
34
37
const fixture = resolveFixture ( 'mismatching_tags.xml' ) ;
35
38
36
39
const { message } = await new Promise ( ( resolve ) => {
37
- gulp . src ( fixture )
40
+ gulp
41
+ . src ( fixture )
38
42
. pipe ( xmlValidator ( ) )
39
- . once ( 'error' , error => resolve ( error ) ) ;
43
+ . once ( 'error' , ( error ) => resolve ( error ) ) ;
40
44
} ) ;
41
45
42
46
assert . ok ( message . includes ( '\x1B[4mmismatching_tags.xml\x1B[24m: <warning> unclosed xml attribute' ) ) ;
@@ -46,9 +50,10 @@ test('fail on missing close tags', async () => {
46
50
const fixture = resolveFixture ( 'missing_close_tag.xml' ) ;
47
51
48
52
const { message } = await new Promise ( ( resolve ) => {
49
- gulp . src ( fixture )
53
+ gulp
54
+ . src ( fixture )
50
55
. pipe ( xmlValidator ( ) )
51
- . once ( 'error' , error => resolve ( error ) ) ;
56
+ . once ( 'error' , ( error ) => resolve ( error ) ) ;
52
57
} ) ;
53
58
54
59
assert . ok ( message . includes ( '\x1B[4mmissing_close_tag.xml\x1B[24m: <warning> unclosed xml attribute' ) ) ;
@@ -58,24 +63,34 @@ test('fail on missing quote', async () => {
58
63
const fixture = resolveFixture ( 'missing_quote.xml' ) ;
59
64
60
65
const { message } = await new Promise ( ( resolve ) => {
61
- gulp . src ( fixture )
66
+ gulp
67
+ . src ( fixture )
62
68
. pipe ( xmlValidator ( ) )
63
- . once ( 'error' , error => resolve ( error ) ) ;
69
+ . once ( 'error' , ( error ) => resolve ( error ) ) ;
64
70
} ) ;
65
71
66
- assert . ok ( message . includes ( `\x1B[4mmissing_quote.xml\x1B[24m: <error> [xmldom error]\telement parse error: Error: attribute value no end '"' match` ) ) ;
72
+ assert . ok (
73
+ message . includes (
74
+ `\x1B[4mmissing_quote.xml\x1B[24m: <error> [xmldom error]\telement parse error: Error: attribute value no end '"' match` ,
75
+ ) ,
76
+ ) ;
67
77
} ) ;
68
78
69
79
test ( 'fail on invalid tag' , async ( ) => {
70
80
const fixture = resolveFixture ( 'invalid_tag.xml' ) ;
71
81
72
82
const { message } = await new Promise ( ( resolve ) => {
73
- gulp . src ( fixture )
83
+ gulp
84
+ . src ( fixture )
74
85
. pipe ( xmlValidator ( ) )
75
- . once ( 'error' , error => resolve ( error ) ) ;
86
+ . once ( 'error' , ( error ) => resolve ( error ) ) ;
76
87
} ) ;
77
88
78
- assert . ok ( message . includes ( '\x1B[4minvalid_tag.xml\x1B[24m: <error> [xmldom error]\telement parse error: Error: invalid tagName:1' ) ) ;
89
+ assert . ok (
90
+ message . includes (
91
+ '\x1B[4minvalid_tag.xml\x1B[24m: <error> [xmldom error]\telement parse error: Error: invalid tagName:1' ,
92
+ ) ,
93
+ ) ;
79
94
} ) ;
80
95
81
96
test . run ( ) ;
0 commit comments