From 3a578d96245b8078c0ba6aa844a46f2fcec7352b Mon Sep 17 00:00:00 2001 From: Yen-Chi Chen Date: Sun, 26 Jul 2020 16:53:55 +0200 Subject: [PATCH] lint --- .../jest-transform/src/ScriptTransformer.ts | 26 +++++++++---------- .../src/__tests__/script_transformer.test.js | 22 +++++++--------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/packages/jest-transform/src/ScriptTransformer.ts b/packages/jest-transform/src/ScriptTransformer.ts index 147c1f66230c..99f23276f656 100644 --- a/packages/jest-transform/src/ScriptTransformer.ts +++ b/packages/jest-transform/src/ScriptTransformer.ts @@ -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( diff --git a/packages/jest-transform/src/__tests__/script_transformer.test.js b/packages/jest-transform/src/__tests__/script_transformer.test.js index 4676b9db865a..07213a9c05fe 100644 --- a/packages/jest-transform/src/__tests__/script_transformer.test.js +++ b/packages/jest-transform/src/__tests__/script_transformer.test.js @@ -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'], @@ -428,7 +426,7 @@ describe('ScriptTransformer', () => { .resolves; }); */ - } + }, ); it("throws an error if `process` doesn't defined", () => {