Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ychi committed May 3, 2020
1 parent 44ccac4 commit 3ea5f17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
],
test: [
'packages/jest-config/src/readConfigFileAndSetRootDir.ts',
'packages/jest-transform/src/ScriptTransformer.ts'
'packages/jest-transform/src/ScriptTransformer.ts',
],
},
],
Expand Down
16 changes: 10 additions & 6 deletions packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import slash = require('slash');
import {sync as writeFileAtomic} from 'write-file-atomic';
import {addHook} from 'pirates';
import type {
AsyncTransformer,
Options,
SyncTransformer,
TransformResult,
TransformedSource,
Transformer,
SyncTransformer,
AsyncTransformer
} from './types';
import shouldInstrument from './shouldInstrument';
import handlePotentialSyntaxError from './enhanceUnexpectedTokenMessage';
Expand Down Expand Up @@ -594,13 +594,17 @@ export default class ScriptTransformer {
let processed: TransformedSource | null = null;

if (transform && shouldCallTransform) {

if(transform.processAsync) {
processed = await transform.processAsync(content, filename, this._config, {
if (transform.processAsync) {
processed = await transform.processAsync(
content,
filename,
this._config,
{
instrument,
supportsDynamicImport,
supportsStaticESM,
})
},
);
} else if (transform.process) {
processed = transform.process(content, filename, this._config, {
instrument,
Expand Down

0 comments on commit 3ea5f17

Please sign in to comment.