File tree Expand file tree Collapse file tree 4 files changed +29
-8
lines changed Expand file tree Collapse file tree 4 files changed +29
-8
lines changed Original file line number Diff line number Diff line change
1
+ import { join } from 'path' ;
1
2
import { statSync } from 'fs' ;
2
3
3
4
// @ts -ignore
4
5
import arrify from 'arrify' ;
5
6
6
- const UNESCAPED_GLOB_SYMBOLS_RE = / ( \\ ? ) ( [ ( ) * ? [ \] { | } ] | ^ ! | [ ! + @ ] (? = \( ) ) / g;
7
-
8
7
/**
9
8
* @param {string|string[] } files
10
9
* @param {string } context
11
10
* @returns {string[] }
12
11
*/
13
12
export function parseFiles ( files , context ) {
14
- return arrify ( files ) . map (
15
- ( /** @type {string } */ file ) =>
16
- `${ replaceBackslashes ( context ) . replace (
17
- UNESCAPED_GLOB_SYMBOLS_RE ,
18
- '\\$2'
19
- ) } /${ replaceBackslashes ( file ) } `
13
+ return arrify ( files ) . map ( ( /** @type {string } */ file ) =>
14
+ replaceBackslashes ( join ( context , file ) )
20
15
) ;
21
16
}
22
17
Original file line number Diff line number Diff line change
1
+ var foo = stuff
Original file line number Diff line number Diff line change
1
+ require ( './error' ) ;
Original file line number Diff line number Diff line change
1
+ import { join } from 'path' ;
2
+
3
+ import pack from './utils/pack' ;
4
+
5
+ describe ( 'symbols' , ( ) => {
6
+ afterEach ( ( ) => {
7
+ jest . restoreAllMocks ( ) ;
8
+ } ) ;
9
+
10
+ it ( 'should return error' , ( done ) => {
11
+ const compiler = pack (
12
+ 'symbols' ,
13
+ { } ,
14
+ { context : join ( __dirname , 'fixtures/[symbols]' ) }
15
+ ) ;
16
+
17
+ compiler . run ( ( err , stats ) => {
18
+ expect ( err ) . toBeNull ( ) ;
19
+ expect ( stats . hasWarnings ( ) ) . toBe ( false ) ;
20
+ expect ( stats . hasErrors ( ) ) . toBe ( true ) ;
21
+ done ( ) ;
22
+ } ) ;
23
+ } ) ;
24
+ } ) ;
You can’t perform that action at this time.
0 commit comments