File tree Expand file tree Collapse file tree
packages/babel-jest/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ jest.mock('../loadBabelConfig', () => {
1414
1515 return {
1616 loadPartialConfig : jest . fn ( ( ...args ) => actual . loadPartialConfig ( ...args ) ) ,
17+ loadPartialConfigAsync : jest . fn ( ( ...args ) =>
18+ actual . loadPartialConfigAsync ( ...args ) ,
19+ ) ,
1720 } ;
1821} ) ;
1922
@@ -49,6 +52,25 @@ test('Returns source string with inline maps when no transformOptions is passed'
4952 expect ( JSON . stringify ( result . map ! . sourcesContent ) ) . toMatch ( 'customMultiply' ) ;
5053} ) ;
5154
55+ test ( 'Returns source string with inline maps when no transformOptions is passed async' , async ( ) => {
56+ const result : any = await babelJest . processAsync ! (
57+ sourceString ,
58+ 'dummy_path.js' ,
59+ {
60+ config : makeProjectConfig ( ) ,
61+ configString : JSON . stringify ( makeProjectConfig ( ) ) ,
62+ instrument : false ,
63+ } ,
64+ ) ;
65+ expect ( typeof result ) . toBe ( 'object' ) ;
66+ expect ( result . code ) . toBeDefined ( ) ;
67+ expect ( result . map ) . toBeDefined ( ) ;
68+ expect ( result . code ) . toMatch ( '//# sourceMappingURL' ) ;
69+ expect ( result . code ) . toMatch ( 'customMultiply' ) ;
70+ expect ( result . map ! . sources ) . toEqual ( [ 'dummy_path.js' ] ) ;
71+ expect ( JSON . stringify ( result . map ! . sourcesContent ) ) . toMatch ( 'customMultiply' ) ;
72+ } ) ;
73+
5274describe ( 'caller option correctly merges from defaults and options' , ( ) => {
5375 test . each ( [
5476 [
You can’t perform that action at this time.
0 commit comments