diff --git a/packages/jest-message-util/src/index.ts b/packages/jest-message-util/src/index.ts index f02a7f0fefeb..b5d0cb605e97 100644 --- a/packages/jest-message-util/src/index.ts +++ b/packages/jest-message-util/src/index.ts @@ -190,6 +190,8 @@ const removeInternalStackEntries = ( ): Array => { let pathCounter = 0; + return lines; + return lines.filter(line => { if (ANONYMOUS_FN_IGNORE.test(line)) { return false; diff --git a/packages/jest-resolve/src/__mocks__/package.json b/packages/jest-resolve/src/__mocks__/package.json new file mode 100644 index 000000000000..2807645e6dca --- /dev/null +++ b/packages/jest-resolve/src/__mocks__/package.json @@ -0,0 +1,6 @@ +{ + "name": "__mocks__", + "version": "1.0.0", + "dependencies": { + } +} diff --git a/packages/jest-resolve/src/__tests__/resolve.test.ts b/packages/jest-resolve/src/__tests__/resolve.test.ts index cfbe99bc841d..738db7ab09de 100644 --- a/packages/jest-resolve/src/__tests__/resolve.test.ts +++ b/packages/jest-resolve/src/__tests__/resolve.test.ts @@ -215,10 +215,7 @@ describe('resolveModule', () => { } as ResolverConfig); const src = require.resolve('../'); const resolved = resolver.resolveModule(src, 'mockJsDependency', { - paths: [ - path.resolve(__dirname, '../../src/__tests__'), - path.resolve(__dirname, '../../src/__mocks__'), - ], + paths: [path.resolve(__dirname, '../../src/__mocks__')], }); expect(resolved).toBe(require.resolve('../__mocks__/mockJsDependency.js')); });