From bd46500a92f2eca26e1536ee6a308404e2dc89e0 Mon Sep 17 00:00:00 2001 From: Jose David Rodriguez Velasco Date: Fri, 5 Aug 2022 12:13:37 -0400 Subject: [PATCH] fix: use inclusive naming --- packages/@lwc/jest-resolver/src/index.js | 6 +++--- .../jest-transformer/src/transforms/client-scoped-import.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@lwc/jest-resolver/src/index.js b/packages/@lwc/jest-resolver/src/index.js index 9a777f46..67ea5888 100644 --- a/packages/@lwc/jest-resolver/src/index.js +++ b/packages/@lwc/jest-resolver/src/index.js @@ -10,7 +10,7 @@ const { resolve, extname, join, dirname, basename } = require('path'); const EMPTY_CSS_MOCK = resolve(__dirname, '..', 'resources', 'emptyStyleMock.js'); const EMPTY_HTML_MOCK = resolve(__dirname, '..', 'resources', 'emptyHtmlMock.js'); -const WHITELISTED_LWC_PACKAGES = { +const ALLOWLISTED_LWC_PACKAGES = { lwc: '@lwc/engine-dom', 'wire-service': '@lwc/wire-service', 'wire-service-jest-util': '@salesforce/wire-service-jest-util', @@ -43,8 +43,8 @@ function getLwcPath(path, options) { path = path.substring(0, path.length - 12); } // If is a special LWC package, resolve it from commonjs - if (WHITELISTED_LWC_PACKAGES[path]) { - return require.resolve(WHITELISTED_LWC_PACKAGES[path]); + if (ALLOWLISTED_LWC_PACKAGES[path]) { + return require.resolve(ALLOWLISTED_LWC_PACKAGES[path]); } // If is a CSS just resolve it to an empty file diff --git a/packages/@lwc/jest-transformer/src/transforms/client-scoped-import.js b/packages/@lwc/jest-transformer/src/transforms/client-scoped-import.js index 5fcf46cf..45c97654 100644 --- a/packages/@lwc/jest-transformer/src/transforms/client-scoped-import.js +++ b/packages/@lwc/jest-transformer/src/transforms/client-scoped-import.js @@ -7,7 +7,7 @@ const { stringScopedImportTransform } = require('./utils'); const CLIENT_IMPORT_IDENTIFIER = '@salesforce/client/'; -const WHITELISTED_RESOURCE_MOCK_VALUE = { +const ALLOWLISTED_RESOURCE_MOCK_VALUE = { formFactor: 'Large', }; @@ -19,7 +19,7 @@ module.exports = function ({ types: t }) { if (importId.startsWith(CLIENT_IMPORT_IDENTIFIER)) { const resourceId = importId.substring(CLIENT_IMPORT_IDENTIFIER.length); - const mockValue = WHITELISTED_RESOURCE_MOCK_VALUE[resourceId]; + const mockValue = ALLOWLISTED_RESOURCE_MOCK_VALUE[resourceId]; stringScopedImportTransform(t, path, importId, mockValue); }