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' ;
12import { statSync } from 'fs' ;
23
34// @ts -ignore
45import arrify from 'arrify' ;
56
6- const UNESCAPED_GLOB_SYMBOLS_RE = / ( \\ ? ) ( [ ( ) * ? [ \] { | } ] | ^ ! | [ ! + @ ] (? = \( ) ) / g;
7-
87/**
98 * @param {string|string[] } files
109 * @param {string } context
1110 * @returns {string[] }
1211 */
1312export 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 ) )
2015 ) ;
2116}
2217
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