Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ychi committed Jul 26, 2020
1 parent d4bbfcc commit 3a578d9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
26 changes: 13 additions & 13 deletions packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,20 +756,20 @@ export default class ScriptTransformer {
}
}

const result = await this._transformAndBuildScriptAsync(
filename,
options,
instrument,
fileSource,
).catch(e=>{
console.log({eno: e});
});
const result = await this._transformAndBuildScriptAsync(
filename,
options,
instrument,
fileSource,
).catch(e => {
console.log({eno: e});
});

if (scriptCacheKey) {
this._cache.transformedFiles.set(scriptCacheKey, result);
}
return result;
if (scriptCacheKey) {
this._cache.transformedFiles.set(scriptCacheKey, result);
}

return result;
}

transform(
Expand Down
22 changes: 10 additions & 12 deletions packages/jest-transform/src/__tests__/script_transformer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,19 +402,17 @@ describe('ScriptTransformer', () => {
];

incorrectReturnValues.forEach(async ([returnValue, filePath]) => {
require('passthrough-async-preprocessor').processAsync
.mockImplementation((returnValue)=> {
console.log({"inside_processAsync": returnValue});
return Promise.resolve(returnValue);
}

require('passthrough-async-preprocessor').processAsync.mockImplementation(
returnValue => {
console.log({inside_processAsync: returnValue});
return Promise.resolve(returnValue);
},
);
await scriptTransformer.transformAsync(filePath, {})
.catch((e)=>{
expect(e.message).toMatch('error');
});
await scriptTransformer.transformAsync(filePath, {}).catch(e => {
expect(e.message).toMatch('error');
});
});
/*
/*
const correctReturnValues = [
['code', '/fruits/banana.js'],
[{code: 'code'}, '/fruits/kiwi.js'],
Expand All @@ -428,7 +426,7 @@ describe('ScriptTransformer', () => {
.resolves;
});
*/
}
},
);

it("throws an error if `process` doesn't defined", () => {
Expand Down

0 comments on commit 3a578d9

Please sign in to comment.