1
- import { xmlValidator } from '../dist /index.js ' ;
1
+ import { xmlValidator } from '../src /index.ts ' ;
2
2
3
3
import { resolve } from 'node:path' ;
4
4
import { test } from 'uvu' ;
5
5
import * as assert from 'uvu/assert' ;
6
6
import gulp from 'gulp' ;
7
+ import type PluginError from 'plugin-error' ;
7
8
8
- function resolveFixture ( fileName ) {
9
+ function resolveFixture ( fileName : string ) {
9
10
return resolve ( process . cwd ( ) , `tests/fixtures/${ fileName } ` ) ;
10
11
}
11
12
@@ -16,7 +17,7 @@ test('should emit error on streamed file', async () => {
16
17
gulp
17
18
. src ( fixture , { buffer : false } )
18
19
. pipe ( xmlValidator ( ) )
19
- . once ( 'error' , ( error ) => resolve ( error ) ) ;
20
+ . once ( 'error' , ( error : PluginError ) => resolve ( error ) ) ;
20
21
} ) ;
21
22
22
23
assert . is ( message , 'Streaming not supported' ) ;
@@ -40,7 +41,7 @@ test('fail on mismatching tags', async () => {
40
41
gulp
41
42
. src ( fixture )
42
43
. pipe ( xmlValidator ( ) )
43
- . once ( 'error' , ( error ) => resolve ( error ) ) ;
44
+ . once ( 'error' , ( error : PluginError ) => resolve ( error ) ) ;
44
45
} ) ;
45
46
46
47
assert . ok ( message . includes ( '\x1B[4mmismatching_tags.xml\x1B[24m: <warning> unclosed xml attribute' ) ) ;
@@ -53,7 +54,7 @@ test('fail on missing close tags', async () => {
53
54
gulp
54
55
. src ( fixture )
55
56
. pipe ( xmlValidator ( ) )
56
- . once ( 'error' , ( error ) => resolve ( error ) ) ;
57
+ . once ( 'error' , ( error : PluginError ) => resolve ( error ) ) ;
57
58
} ) ;
58
59
59
60
assert . ok ( message . includes ( '\x1B[4mmissing_close_tag.xml\x1B[24m: <warning> unclosed xml attribute' ) ) ;
@@ -66,7 +67,7 @@ test('fail on missing quote', async () => {
66
67
gulp
67
68
. src ( fixture )
68
69
. pipe ( xmlValidator ( ) )
69
- . once ( 'error' , ( error ) => resolve ( error ) ) ;
70
+ . once ( 'error' , ( error : PluginError ) => resolve ( error ) ) ;
70
71
} ) ;
71
72
72
73
assert . ok (
@@ -83,7 +84,7 @@ test('fail on invalid tag', async () => {
83
84
gulp
84
85
. src ( fixture )
85
86
. pipe ( xmlValidator ( ) )
86
- . once ( 'error' , ( error ) => resolve ( error ) ) ;
87
+ . once ( 'error' , ( error : PluginError ) => resolve ( error ) ) ;
87
88
} ) ;
88
89
89
90
assert . ok (
0 commit comments