File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` Errors Loader Error 1` ] = ` "Cannot read property 'version' of undefined"` ;
4+
5+ exports [` Errors Validation Error 1` ] = `
6+ "binaryen-loader
7+
8+ [4mOptions Validation Error[24m
9+
10+ [2moptions[22m['useRelativePath'] [34mis an invalid additional property[39m
11+ "
12+ ` ;
Original file line number Diff line number Diff line change 1+ import loader from '../src' ;
2+ import CJSLoader from '../src/cjs' ;
3+
4+ describe ( 'CJS' , ( ) => {
5+ it ( 'should export loader' , ( ) => {
6+ expect ( CJSLoader ) . toEqual ( loader ) ;
7+ } ) ;
8+
9+ it ( 'should export `raw` flag' , ( ) => {
10+ expect ( CJSLoader . raw ) . toEqual ( false ) ;
11+ } ) ;
12+ } ) ;
Original file line number Diff line number Diff line change 1+ import loader from '../src' ;
2+
3+ describe ( 'Errors' , ( ) => {
4+ test ( 'Loader Error' , ( ) => {
5+ const err = ( ) => loader . call ( ) ;
6+
7+ expect ( err ) . toThrow ( ) ;
8+ expect ( err ) . toThrowErrorMatchingSnapshot ( ) ;
9+ } ) ;
10+
11+ test ( 'Validation Error' , ( ) => {
12+ const err = ( ) =>
13+ loader . call ( {
14+ query : { useRelativePath : 1 } ,
15+ emitFile : true ,
16+ } ) ;
17+
18+ expect ( err ) . toThrow ( ) ;
19+ expect ( err ) . toThrowErrorMatchingSnapshot ( ) ;
20+ } ) ;
21+ } ) ;
You can’t perform that action at this time.
0 commit comments