File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
test/friendly-errors/transformers Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -60,5 +60,18 @@ describe('transform/missing-loader', () => {
6060 expect ( actualError . type ) . to . deep . equal ( 'loader-not-enabled' ) ;
6161 expect ( actualError . loaderName ) . to . deep . equal ( 'sass' ) ;
6262 } ) ;
63+
64+ it ( 'Typescript error is properly transformed' , ( ) => {
65+ const startError = {
66+ name : 'ModuleParseError' ,
67+ message : 'You may need an appropriate loader' ,
68+ file : '/path/to/file.ts'
69+ } ;
70+ const actualError = transform ( Object . assign ( { } , startError ) ) ;
71+
72+ expect ( actualError . name ) . to . deep . equal ( 'Loader not enabled' ) ;
73+ expect ( actualError . type ) . to . deep . equal ( 'loader-not-enabled' ) ;
74+ expect ( actualError . loaderName ) . to . deep . equal ( 'typescript' ) ;
75+ } ) ;
6376 } ) ;
6477} ) ;
You can’t perform that action at this time.
0 commit comments