File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -273,19 +273,19 @@ const generateUnformattedCode = (
273
273
const formatCode = ( code : string ) => {
274
274
// in test environment, window.api is not defined,
275
275
// so we reference original prettier format function instead
276
- // if (process.env.NODE_ENV === 'test') {
277
- // const { format } = require('prettier');
278
- // return format(code, {
279
- // singleQuote: true,
280
- // trailingComma: 'es5',
281
- // bracketSpacing: true,
282
- // jsxBracketSameLine: true,
283
- // parser: 'babel'
284
- // });
285
- // } else {
286
- // return window.api.formatCode(code);
287
- // }
288
- return code ;
276
+ if ( process . env . NODE_ENV === 'test' ) {
277
+ const { format } = require ( 'prettier' ) ;
278
+ return format ( code , {
279
+ singleQuote : true ,
280
+ trailingComma : 'es5' ,
281
+ bracketSpacing : true ,
282
+ jsxBracketSameLine : true ,
283
+ parser : 'babel'
284
+ } ) ;
285
+ } else {
286
+ return window . api . formatCode ( code ) ;
287
+ }
288
+ // return code;
289
289
290
290
} ;
291
291
You can’t perform that action at this time.
0 commit comments