From 3239f25af1b5d3d8f5aa08501d1105d50570e0de Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Fri, 18 Dec 2020 23:50:34 +0100 Subject: [PATCH 1/9] Map last know meta element parent folder --- src/service/standardHandler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/service/standardHandler.js b/src/service/standardHandler.js index 3bb8414e..6d12985f 100644 --- a/src/service/standardHandler.js +++ b/src/service/standardHandler.js @@ -68,7 +68,12 @@ class StandardHandler { _getParsedPath() { return path.parse( - this.splittedLine[this.splittedLine.indexOf(this.type) + 1] + this.splittedLine + .slice( + this.splittedLine.findIndex(x => x.includes(mc.METAFILE_SUFFIX)) - 1 + ) + .join(path.sep) + .replace(mc.META_REGEX, '') .replace(this.suffixRegex, '') ) @@ -76,7 +81,7 @@ class StandardHandler { _getElementName() { const parsedPath = this._getParsedPath() - return parsedPath.dir + parsedPath.base + return parsedPath.base } _fillPackage(packageObject) { From ce73a8ceba4ee08340e531cf417fbe0d12148203 Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Fri, 18 Dec 2020 23:51:55 +0100 Subject: [PATCH 2/9] Specialize the inResource handler So it have the previous behavior of the standardHandler --- src/service/inResourceHandler.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/service/inResourceHandler.js b/src/service/inResourceHandler.js index 76fb2559..e7b48b1f 100644 --- a/src/service/inResourceHandler.js +++ b/src/service/inResourceHandler.js @@ -2,6 +2,7 @@ const StandardHandler = require('./standardHandler') const path = require('path') const fs = require('fs') +const mc = require('../utils/metadataConstants') const elementSrc = {} @@ -54,7 +55,15 @@ class ResourceHandler extends StandardHandler { _getElementName() { const parsedPath = this._getParsedPath() - return parsedPath.dir + parsedPath.name + return parsedPath.name + } + + _getParsedPath() { + return path.parse( + this.splittedLine[this.splittedLine.indexOf(this.type) + 1] + .replace(mc.META_REGEX, '') + .replace(this.suffixRegex, '') + ) } } From e04f962bba1d666ddfe976af1fc53a365c6f68fc Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Fri, 18 Dec 2020 23:52:38 +0100 Subject: [PATCH 3/9] Remove unused handler anymore and references --- .../unit/lib/service/lightningHandler.test.js | 26 ----------------- .../service/subFolderElementHandler.test.js | 28 ------------------- src/service/lightningHandler.js | 19 ------------- src/service/subFolderElementHandler.js | 18 ------------ src/service/typeHandlerFactory.js | 7 ++--- 5 files changed, 2 insertions(+), 96 deletions(-) delete mode 100644 __tests__/unit/lib/service/lightningHandler.test.js delete mode 100644 __tests__/unit/lib/service/subFolderElementHandler.test.js delete mode 100644 src/service/lightningHandler.js delete mode 100644 src/service/subFolderElementHandler.js diff --git a/__tests__/unit/lib/service/lightningHandler.test.js b/__tests__/unit/lib/service/lightningHandler.test.js deleted file mode 100644 index 8461829a..00000000 --- a/__tests__/unit/lib/service/lightningHandler.test.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' -const Lightning = require('../../../../src/service/lightningHandler') -jest.mock('fs') - -const testContext = { - handler: Lightning, - testData: [ - [ - 'lwc', - 'force-app/main/default/lwc/component/component.js-meta.xml', - new Set(['component']), - ], - [ - 'aura', - 'force-app/main/default/aura/component/component.cmp-meta.xml', - new Set(['component']), - ], - ], - work: { - config: { output: '', repo: '', generateDelta: true }, - diffs: { package: {}, destructiveChanges: {} }, - }, -} - -// eslint-disable-next-line no-undef -testHandlerHelper(testContext) diff --git a/__tests__/unit/lib/service/subFolderElementHandler.test.js b/__tests__/unit/lib/service/subFolderElementHandler.test.js deleted file mode 100644 index 402fa537..00000000 --- a/__tests__/unit/lib/service/subFolderElementHandler.test.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict' -const SubFolderElementHandler = require('../../../../src/service/subFolderElementHandler') -jest.mock('fs') - -const testContext = { - handler: SubFolderElementHandler, - testData: [ - [ - 'classes', - 'force-app/main/default/classes/Controller.cls-meta.xml', - new Set(['Controller']), - 'classes', - ], - [ - 'classes', - 'force-app/main/default/classes/controllers/Controller.cls-meta.xml', - new Set(['Controller']), - 'classes', - ], - ], - work: { - config: { output: '', repo: '', generateDelta: true }, - diffs: { package: {}, destructiveChanges: {} }, - }, -} - -// eslint-disable-next-line no-undef -testHandlerHelper(testContext) diff --git a/src/service/lightningHandler.js b/src/service/lightningHandler.js deleted file mode 100644 index 835271dc..00000000 --- a/src/service/lightningHandler.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict' -const StandardHandler = require('./standardHandler') -const path = require('path') - -class LightningHandler extends StandardHandler { - handleAddition() { - super.handleAddition() - if (!this.config.generateDelta) return - - const fileName = this.splittedLine.slice(0, -1).join(path.sep) - - this._copyFiles( - path.join(this.config.repo, fileName), - path.join(this.config.output, fileName) - ) - } -} - -module.exports = LightningHandler diff --git a/src/service/subFolderElementHandler.js b/src/service/subFolderElementHandler.js deleted file mode 100644 index d3b0d9af..00000000 --- a/src/service/subFolderElementHandler.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' -const StandardHandler = require('./standardHandler') -const mc = require('../utils/metadataConstants') -const path = require('path') - -class SubFolderElementHandler extends StandardHandler { - _getParsedPath() { - return path.parse( - this.splittedLine - .slice(this.splittedLine.length - 1) - .join(path.sep) - .replace(mc.META_REGEX, '') - .replace(this.suffixRegex, '') - ) - } -} - -module.exports = SubFolderElementHandler diff --git a/src/service/typeHandlerFactory.js b/src/service/typeHandlerFactory.js index 0983889d..a6cd9bab 100644 --- a/src/service/typeHandlerFactory.js +++ b/src/service/typeHandlerFactory.js @@ -3,19 +3,16 @@ const CustomObject = require('./customObjectHandler') const InFile = require('./inFileHandler') const InFolder = require('./inFolderHandler') const InResource = require('./inResourceHandler') -const Lightning = require('./lightningHandler') const Standard = require('./standardHandler') const SubCustomObject = require('./subCustomObjectHandler') -const SubFolderElementHandler = require('./subFolderElementHandler') const InTranslation = require('./inTranslationHandler') const Wave = require('./waveHandler') const path = require('path') const classes = { - aura: Lightning, + aura: InResource, businessProcesses: SubCustomObject, - classes: SubFolderElementHandler, compactLayouts: SubCustomObject, dashboards: InFolder, documents: InFolder, @@ -25,7 +22,7 @@ const classes = { fields: SubCustomObject, labels: InFile, listViews: SubCustomObject, - lwc: Lightning, + lwc: InResource, objects: CustomObject, objectTranslations: InTranslation, recordTypes: SubCustomObject, From a0e554bf13c19ab379dfec97321a4959a4ebe881 Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Fri, 18 Dec 2020 23:54:06 +0100 Subject: [PATCH 4/9] Move test from removed files --- __tests__/unit/lib/service/inResourceHandler.test.js | 10 ++++++++++ __tests__/unit/lib/service/standardHandler.test.js | 5 +++++ __tests__/unit/lib/service/typeHandlerFactory.test.js | 4 +--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/__tests__/unit/lib/service/inResourceHandler.test.js b/__tests__/unit/lib/service/inResourceHandler.test.js index 3cdde25f..c6f7fa0a 100644 --- a/__tests__/unit/lib/service/inResourceHandler.test.js +++ b/__tests__/unit/lib/service/inResourceHandler.test.js @@ -26,6 +26,16 @@ const testContext = { 'force-app/main/default/waveTemplates/WaveTemplateTest/template-info.json', new Set(['WaveTemplateTest']), ], + [ + 'lwc', + 'force-app/main/default/lwc/component/component.js-meta.xml', + new Set(['component']), + ], + [ + 'aura', + 'force-app/main/default/aura/component/component.cmp-meta.xml', + new Set(['component']), + ], ], work: { config: { output: '', repo: '', generateDelta: true }, diff --git a/__tests__/unit/lib/service/standardHandler.test.js b/__tests__/unit/lib/service/standardHandler.test.js index 4a0c31cd..8150a0e6 100644 --- a/__tests__/unit/lib/service/standardHandler.test.js +++ b/__tests__/unit/lib/service/standardHandler.test.js @@ -30,6 +30,11 @@ const testContext = { 'force-app/main/default/objects/Account/weblinks/ClientStore.weblink-meta.xml', new Set(['ClientStore']), ], + [ + 'classes', + 'force-app/main/default/classes/controllers/Controller.cls-meta.xml', + new Set(['Controller']), + ], ], work: { config: { output: '', repo: '', generateDelta: true }, diff --git a/__tests__/unit/lib/service/typeHandlerFactory.test.js b/__tests__/unit/lib/service/typeHandlerFactory.test.js index 728855d4..a36434e0 100644 --- a/__tests__/unit/lib/service/typeHandlerFactory.test.js +++ b/__tests__/unit/lib/service/typeHandlerFactory.test.js @@ -2,7 +2,6 @@ const SubCustomObject = require('../../../../src/service/subCustomObjectHandler') const InResource = require('../../../../src/service/inResourceHandler') -const Lightning = require('../../../../src/service/lightningHandler') const InFolder = require('../../../../src/service/inFolderHandler') const Standard = require('../../../../src/service/standardHandler') const TypeHandlerFactory = require('../../../../src/service/typeHandlerFactory') @@ -20,7 +19,6 @@ describe('the type handler factory', () => { ) }) describe.each([ - [Lightning, ['aura', 'lwc']], [ SubCustomObject, [ @@ -36,7 +34,7 @@ describe('the type handler factory', () => { ], ], [InFolder, ['dashboards', 'documents', 'reports']], - [InResource, ['staticresources']], + [InResource, ['staticresources', 'aura', 'lwc']], [Standard, ['objects']], ])('give %p handler', (handler, types) => { test.each(types)('for %s folder', type => { From eb34e00db6cffac1a99dd4526d1a21e085de0daa Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Sat, 19 Dec 2020 00:10:44 +0100 Subject: [PATCH 5/9] Improve template with command line to provide context information --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index abeafc0b..3f2fb009 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -67,6 +67,10 @@ _(Write your answer here.)_ --- + + **Operating System:** … **Yarn version:** … From d39c0caa158d39938839ed179a4b295f21e6b6ac Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Mon, 21 Dec 2020 18:31:59 +0100 Subject: [PATCH 6/9] make sure not sending code coverage from other repo does not create an issue in the PR checks --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ab6425bd..0a51bf62 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -48,3 +48,4 @@ jobs: - name: 'Code Climate coverage publishing' run: ./cc-test-reporter after-build -t lcov -r ${{ secrets.CC_TEST_REPORTER_ID }} + continue-on-error: true From f8647754c0e117a1b8055a2bb97243cd157f0cd9 Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Sun, 10 Jan 2021 18:17:46 +0100 Subject: [PATCH 7/9] Fix issue when there is no field sub folder for objects --- src/service/customObjectHandler.js | 38 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/service/customObjectHandler.js b/src/service/customObjectHandler.js index e3aace13..9e9914a0 100644 --- a/src/service/customObjectHandler.js +++ b/src/service/customObjectHandler.js @@ -11,27 +11,29 @@ class CustomObjectHandler extends StandardHandler { handleAddition() { super.handleAddition() if (!this.config.generateDelta || this.type !== OBJECT_TYPE) return - const fieldsFolder = path.join( - path.parse(this.line).dir, - mc.FIELD_DIRECTORY_NAME + const fieldsFolder = path.resolve( + this.config.repo, + path.join(path.parse(this.line).dir, mc.FIELD_DIRECTORY_NAME) ) - fs.readdirSync(path.resolve(this.config.repo, fieldsFolder)) - .filter(fieldPath => - fs - .readFileSync( - path.resolve(this.config.repo, fieldsFolder, fieldPath), - { - encoding: gc.UTF8_ENCODING, - } + if (fs.existsSync(fieldsFolder)) { + fs.readdirSync(fieldsFolder) + .filter(fieldPath => + fs + .readFileSync( + path.resolve(this.config.repo, fieldsFolder, fieldPath), + { + encoding: gc.UTF8_ENCODING, + } + ) + .includes(mc.MASTER_DETAIL_TAG) + ) + .forEach(field => + this._copyFiles( + path.resolve(this.config.repo, fieldsFolder, field), + path.resolve(this.config.output, fieldsFolder, field) ) - .includes(mc.MASTER_DETAIL_TAG) - ) - .forEach(field => - this._copyFiles( - path.resolve(this.config.repo, fieldsFolder, field), - path.resolve(this.config.output, fieldsFolder, field) ) - ) + } } } From 64195e6becaad22b38fc40f5c0cabd8564d2a53b Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Sun, 10 Jan 2021 18:59:38 +0100 Subject: [PATCH 8/9] Add test for sub folder use cases --- .../lib/service/customObjectHandler.test.js | 9 ++++ .../unit/lib/service/inFileHandler.test.js | 16 +++++++ .../unit/lib/service/standardHandler.test.js | 30 +++++++++++++ .../service/subCustomObjectHandler.test.js | 15 +++++++ .../unit/lib/service/waveHandler.test.js | 42 +++++++++++++++++++ 5 files changed, 112 insertions(+) diff --git a/__tests__/unit/lib/service/customObjectHandler.test.js b/__tests__/unit/lib/service/customObjectHandler.test.js index e1f8d7db..4f181f05 100644 --- a/__tests__/unit/lib/service/customObjectHandler.test.js +++ b/__tests__/unit/lib/service/customObjectHandler.test.js @@ -11,6 +11,11 @@ const testContext = { 'force-app/main/default/objects/Account/Account.object-meta.xml', new Set(['Account']), ], + [ + 'objects', + 'force-app/main/default/objects/Test/Account/Account.object-meta.xml', + new Set(['Account']), + ], [ 'territory2Models', 'force-app/main/default/territory2Models/EU/EU.territory2Model-meta.xml', @@ -30,6 +35,10 @@ describe('test CustomObjectHandler', () => { 'force-app/main/default/objects/Account/Account.object-meta.xml': 'test', 'force-app/main/default/objects/Account/fields/test__c.field-meta.xml': SubCustomObjectHandler.MASTER_DETAIL_TAG, + 'force-app/main/default/objects/Test/Account/Account.object-meta.xml': + 'test', + 'force-app/main/default/objects/Test/Account/fields/test__c.field-meta.xml': + SubCustomObjectHandler.MASTER_DETAIL_TAG, }) }) diff --git a/__tests__/unit/lib/service/inFileHandler.test.js b/__tests__/unit/lib/service/inFileHandler.test.js index cc53dc32..28afa49b 100644 --- a/__tests__/unit/lib/service/inFileHandler.test.js +++ b/__tests__/unit/lib/service/inFileHandler.test.js @@ -21,6 +21,12 @@ const testContext = { `${os.EOL}${os.EOL}${os.EOL}TestEA${os.EOL}${os.EOL}${os.EOL}TestFU${os.EOL}${os.EOL}${os.EOL}TestRule${os.EOL}${os.EOL}${os.EOL}`, '{"Workflow":{"$":{"xmlns":"http://soap.sforce.com/2006/04/metadata"},"alerts":[{"fullName":["TestEA"]}],"fieldUpdates":[{"fullName":["TestFU"]}],"rules":[{"fullName":["TestRule"]}]}}', ], + [ + 'workflows', + 'force-app/main/default/workflows/Test/Account.workflow-meta.xml', + `${os.EOL}${os.EOL}${os.EOL}TestEA${os.EOL}${os.EOL}${os.EOL}TestFU${os.EOL}${os.EOL}${os.EOL}TestRule${os.EOL}${os.EOL}${os.EOL}`, + '{"Workflow":{"$":{"xmlns":"http://soap.sforce.com/2006/04/metadata"},"alerts":[{"fullName":["TestEA"]}],"fieldUpdates":[{"fullName":["TestFU"]}],"rules":[{"fullName":["TestRule"]}]}}', + ], [ 'labels', 'force-app/main/default/labels/CustomLabels.labels-meta.xml', @@ -33,6 +39,12 @@ const testContext = { `${os.EOL}${os.EOL}${os.EOL}TestCBS${os.EOL}${os.EOL}${os.EOL}TestOBS${os.EOL}${os.EOL}`, '{"SharingRules":{"$":{"xmlns":"http://soap.sforce.com/2006/04/metadata"},"sharingCriteriaRules":[{"fullName":["TestCBS"]}],"sharingOwnerRules":[{"fullName":["TestOBS"]}]}}', ], + [ + 'sharingRules', + 'force-app/main/default/sharingRules/Test/Account.sharingRules-meta.xml', + `${os.EOL}${os.EOL}${os.EOL}TestCBS${os.EOL}${os.EOL}${os.EOL}TestOBS${os.EOL}${os.EOL}`, + '{"SharingRules":{"$":{"xmlns":"http://soap.sforce.com/2006/04/metadata"},"sharingCriteriaRules":[{"fullName":["TestCBS"]}],"sharingOwnerRules":[{"fullName":["TestOBS"]}]}}', + ], ], expectedData: { workflows: { 'workflows.alerts': new Set(['Account.TestEA']) }, @@ -51,12 +63,16 @@ fsMocked.__setMockFiles({ [testContext.testData[0][1]]: testContext.testData[0][2], [testContext.testData[1][1]]: testContext.testData[1][2], [testContext.testData[2][1]]: testContext.testData[2][2], + [testContext.testData[3][1]]: testContext.testData[3][2], + [testContext.testData[4][1]]: testContext.testData[4][2], }) xml2jsMocked.__setMockContent({ [testContext.testData[0][2]]: testContext.testData[0][3], [testContext.testData[1][2]]: testContext.testData[1][3], [testContext.testData[2][2]]: testContext.testData[2][3], + [testContext.testData[3][2]]: testContext.testData[3][3], + [testContext.testData[4][2]]: testContext.testData[4][3], }) // eslint-disable-next-line no-undef diff --git a/__tests__/unit/lib/service/standardHandler.test.js b/__tests__/unit/lib/service/standardHandler.test.js index 8150a0e6..4444bd05 100644 --- a/__tests__/unit/lib/service/standardHandler.test.js +++ b/__tests__/unit/lib/service/standardHandler.test.js @@ -35,6 +35,36 @@ const testContext = { 'force-app/main/default/classes/controllers/Controller.cls-meta.xml', new Set(['Controller']), ], + [ + 'objects', + 'force-app/main/default/objects/Test/Account/Account.object-meta.xml', + new Set(['Account']), + ], + [ + 'quickActions', + 'force-app/main/default/quickActions/Test/Account.New.quickAction-meta.xml', + new Set(['Account.New']), + ], + [ + 'quickActions', + 'force-app/main/default/quickActions/Test/NewGlobal.quickAction-meta.xml', + new Set(['NewGlobal']), + ], + [ + 'customMetadata', + 'force-app/main/default/customMetadata/Test/GraphicsPackImages.md_png.md-meta.xml', + new Set(['GraphicsPackImages.md_png']), + ], + [ + 'weblinks', + 'force-app/main/default/objects/Test/Account/weblinks/ClientStore.weblink-meta.xml', + new Set(['ClientStore']), + ], + [ + 'classes', + 'force-app/main/default/classes/Test/Controller.cls-meta.xml', + new Set(['Controller']), + ], ], work: { config: { output: '', repo: '', generateDelta: true }, diff --git a/__tests__/unit/lib/service/subCustomObjectHandler.test.js b/__tests__/unit/lib/service/subCustomObjectHandler.test.js index 8f15accc..7dd8d00a 100644 --- a/__tests__/unit/lib/service/subCustomObjectHandler.test.js +++ b/__tests__/unit/lib/service/subCustomObjectHandler.test.js @@ -20,6 +20,21 @@ const testContext = { 'force-app/main/default/territory2Models/EU/territories/France.territory2-meta.xml', new Set(['EU.France']), ], + [ + 'fields', + 'force-app/main/default/objects/Test/Account/fields/awesome.field-meta.xml', + new Set(['Account.awesome']), + ], + [ + 'rules', + 'force-app/main/default/territory2Models/Test/EU/rules/Location.territory2Rule-meta.xml', + new Set(['EU.Location']), + ], + [ + 'territories', + 'force-app/main/default/territory2Models/Test/EU/territories/France.territory2-meta.xml', + new Set(['EU.France']), + ], ], work: { config: { output: '', repo: '', generateDelta: true }, diff --git a/__tests__/unit/lib/service/waveHandler.test.js b/__tests__/unit/lib/service/waveHandler.test.js index a3f773a0..d7114744 100644 --- a/__tests__/unit/lib/service/waveHandler.test.js +++ b/__tests__/unit/lib/service/waveHandler.test.js @@ -47,6 +47,48 @@ const testContext = { new Set(['WaveXmdTest']), 'WaveXmd', ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveApplicationTest.wapp', + new Set(['WaveApplicationTest']), + 'WaveApplication', + ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveDataflowTest.wdf', + new Set(['WaveDataflowTest']), + 'WaveDataflow', + ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveDashboardTest.wdash', + new Set(['WaveDashboardTest']), + 'WaveDashboard', + ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveDatasetTest.wds', + new Set(['WaveDatasetTest']), + 'WaveDataset', + ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveLensTest.wlens', + new Set(['WaveLensTest']), + 'WaveLens', + ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveRecipeTest.wdpr', + new Set(['WaveRecipeTest']), + 'WaveRecipe', + ], + [ + 'wave', + 'force-app/main/default/wave/Test/WaveXmdTest.xmd', + new Set(['WaveXmdTest']), + 'WaveXmd', + ], ], work: { config: { output: '', repo: '', generateDelta: true }, From 28ce0892c1f7c02a752358af96100d9d5f36243d Mon Sep 17 00:00:00 2001 From: Sebastien Colladon Date: Sun, 10 Jan 2021 19:00:14 +0100 Subject: [PATCH 9/9] Improve test writing for inTranslationHandler Use variables content for mock --- __tests__/unit/lib/service/inTranslationHandler.test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/__tests__/unit/lib/service/inTranslationHandler.test.js b/__tests__/unit/lib/service/inTranslationHandler.test.js index 6fefdd72..8aa40527 100644 --- a/__tests__/unit/lib/service/inTranslationHandler.test.js +++ b/__tests__/unit/lib/service/inTranslationHandler.test.js @@ -27,10 +27,8 @@ const testContext = { describe('test inTranslation with delta generation', () => { beforeAll(() => { require('fs').__setMockFiles({ - 'force-app/main/default/objectTranslations/Account-es/Account-es.objectTranslation-meta.xml': - 'test', - 'force-app/main/default/objectTranslations/Account-es/BillingFloor__c.fieldTranslation-meta.xml': - 'test', + [testContext.testData[0][1]]: 'test', + [testContext.testData[1][1]]: 'test', }) })