diff --git a/.eslintrc b/.eslintrc index 3cfb446..bd3938b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,7 @@ }, "overrides": [ { - "files": ["src/lightning-stubs/**", "src/apex-stubs/**"], + "files": ["src/lightning-stubs/**"], "parser": "babel-eslint", "parserOptions": { "sourceType": "module" diff --git a/src/apex-stubs/method/method.js b/src/apex-stubs/method/method.js deleted file mode 100644 index 072a3de..0000000 --- a/src/apex-stubs/method/method.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2021, salesforce.com, inc. - * All rights reserved. - * SPDX-License-Identifier: MIT - * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT - */ -import { createApexTestWireAdapter } from '@salesforce/wire-service-jest-util'; - -export default createApexTestWireAdapter(jest.fn()); diff --git a/src/resolver.js b/src/resolver.js index bf72ff1..4300885 100644 --- a/src/resolver.js +++ b/src/resolver.js @@ -47,21 +47,13 @@ function resolveAsFile(name, extensions) { return undefined; } -function getModuleMock(modulePath, moduleName) { - const p = path.join(__dirname, modulePath, moduleName); +function getLightningMock(modulePath) { + const p = path.join(__dirname, 'lightning-stubs', modulePath); if (fs.existsSync(p)) { - return path.join(p, moduleName + '.js'); + return path.join(p, modulePath + '.js'); } } -function getLightningMock(moduleName) { - return getModuleMock('lightning-stubs', moduleName); -} - -function getApexMock(moduleName) { - return getModuleMock('apex-stubs', moduleName); -} - function getModule(modulePath, options) { const { ns, name } = getInfoFromId(modulePath); @@ -69,14 +61,6 @@ function getModule(modulePath, options) { return getLightningMock(name); } - // See https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_salesforce_modules - if ( - modulePath.startsWith('@salesforce/apex/') || - modulePath.startsWith('@salesforce/apexContinuation/') - ) { - return getApexMock('method'); - } - if (ns === DEFAULT_NAMESPACE) { const paths = getModulePaths(); for (let i = 0; i < paths.length; i++) {