diff --git a/test/commands/deploy.nut.ts b/test/commands/deploy.nut.ts index b7f13afc..8e6ed314 100644 --- a/test/commands/deploy.nut.ts +++ b/test/commands/deploy.nut.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { writeJson } from '../../src/commands/deploy.js'; import { TestLevel } from '../../src/utils/types.js'; @@ -17,7 +18,7 @@ describe('deploy NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata.nut.ts b/test/commands/deploy/metadata.nut.ts index 487d2aca..4760d0a1 100644 --- a/test/commands/deploy/metadata.nut.ts +++ b/test/commands/deploy/metadata.nut.ts @@ -5,6 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; describe('deploy metadata NUTs', () => { @@ -13,7 +14,7 @@ describe('deploy metadata NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata/quick.nut.ts b/test/commands/deploy/metadata/quick.nut.ts index da6eab6a..d7636c33 100644 --- a/test/commands/deploy/metadata/quick.nut.ts +++ b/test/commands/deploy/metadata/quick.nut.ts @@ -5,6 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, config } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; @@ -17,7 +18,7 @@ describe('deploy metadata quick NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata/report-mdapi.nut.ts b/test/commands/deploy/metadata/report-mdapi.nut.ts index b86333de..d838828b 100644 --- a/test/commands/deploy/metadata/report-mdapi.nut.ts +++ b/test/commands/deploy/metadata/report-mdapi.nut.ts @@ -7,6 +7,7 @@ import { unlinkSync, existsSync } from 'node:fs'; import { join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, expect } from 'chai'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; @@ -20,7 +21,7 @@ describe('[project deploy report] NUTs with metadata-dir', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), scratchOrgs: [{ duration: 1, alias: orgAlias, config: join('config', 'project-scratch-def.json') }], }); await testkit.convert({ diff --git a/test/commands/deploy/metadata/report.nut.ts b/test/commands/deploy/metadata/report.nut.ts index 69004d76..a4ce3620 100644 --- a/test/commands/deploy/metadata/report.nut.ts +++ b/test/commands/deploy/metadata/report.nut.ts @@ -7,6 +7,7 @@ import { unlinkSync, existsSync } from 'node:fs'; import { join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, isObject } from '@salesforce/ts-types'; import { expect } from 'chai'; @@ -20,7 +21,7 @@ describe('[project deploy report] NUTs with source-dir', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), scratchOrgs: [{ duration: 1, alias: orgAlias, config: join('config', 'project-scratch-def.json') }], }); }); diff --git a/test/commands/deploy/metadata/resume.nut.ts b/test/commands/deploy/metadata/resume.nut.ts index d1ff038a..8afa3c6f 100644 --- a/test/commands/deploy/metadata/resume.nut.ts +++ b/test/commands/deploy/metadata/resume.nut.ts @@ -6,6 +6,7 @@ */ import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import * as path from 'node:path'; import { strict as assert } from 'node:assert'; import { SourceTestkit } from '@salesforce/source-testkit'; @@ -26,7 +27,7 @@ describe('[project deploy resume] NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata/validate.nut.ts b/test/commands/deploy/metadata/validate.nut.ts index 5dc1506c..5fa12870 100644 --- a/test/commands/deploy/metadata/validate.nut.ts +++ b/test/commands/deploy/metadata/validate.nut.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { isObject } from '@salesforce/ts-types'; import { assert, expect } from 'chai'; @@ -18,7 +19,7 @@ describe('deploy metadata validate NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/nuts/delete/source.nut.ts b/test/nuts/delete/source.nut.ts index 2ed79d06..f1d3c2fe 100644 --- a/test/nuts/delete/source.nut.ts +++ b/test/nuts/delete/source.nut.ts @@ -6,6 +6,7 @@ */ import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import * as path from 'node:path'; import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; @@ -109,7 +110,7 @@ describe('project delete source NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ - nut: __filename, + nut: fileURLToPath(import.meta.url), repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', }); execCmd('project:deploy:start --source-dir force-app', { ensureExitCode: 0 }); diff --git a/test/nuts/destructive/destructiveChanges.nut.ts b/test/nuts/destructive/destructiveChanges.nut.ts index 053f2c5a..4f528df2 100644 --- a/test/nuts/destructive/destructiveChanges.nut.ts +++ b/test/nuts/destructive/destructiveChanges.nut.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; import { SourceTestkit } from '@salesforce/source-testkit'; @@ -47,7 +48,7 @@ describe('project deploy start --destructive NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ - nut: __filename, + nut: fileURLToPath(import.meta.url), repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', }); execCmd('project:deploy:start --source-dir force-app', { ensureExitCode: 0 }); diff --git a/test/nuts/retrieve/metadata.nut.ts b/test/nuts/retrieve/metadata.nut.ts index bb51e45f..8b2bad21 100644 --- a/test/nuts/retrieve/metadata.nut.ts +++ b/test/nuts/retrieve/metadata.nut.ts @@ -7,6 +7,7 @@ import * as path from 'node:path'; import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { execCmd } from '@salesforce/cli-plugins-testkit'; import { SourceTestkit } from '@salesforce/source-testkit'; import { expect } from 'chai'; @@ -19,7 +20,7 @@ describe('retrieve metadata NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); await testkit.addTestFiles(); await testkit.deploy({ args: '--source-dir force-app', exitCode: 0 }); diff --git a/test/nuts/seeds/deploy.metadata.manifest.seed.ts b/test/nuts/seeds/deploy.metadata.manifest.seed.ts index e21a336f..6fddc705 100644 --- a/test/nuts/seeds/deploy.metadata.manifest.seed.ts +++ b/test/nuts/seeds/deploy.metadata.manifest.seed.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert } from 'chai'; import { TEST_REPOS_MAP } from '../testMatrix.js'; @@ -20,7 +21,7 @@ context('deploy metadata --manifest NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); // some deploys reference other metadata not included in the deploy, if it's not already in the org it will fail const args = testkit.packageNames.map((p) => `--source-dir ${p}`).join(' '); diff --git a/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts b/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts index 7ace3ee0..feaab68a 100644 --- a/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts +++ b/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; import { JsonMap } from '@salesforce/ts-types'; @@ -22,7 +23,7 @@ context('deploy metadata --metadata-dir NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/nuts/seeds/deploy.metadata.metadata.seed.ts b/test/nuts/seeds/deploy.metadata.metadata.seed.ts index 7614e20a..166866a0 100644 --- a/test/nuts/seeds/deploy.metadata.metadata.seed.ts +++ b/test/nuts/seeds/deploy.metadata.metadata.seed.ts @@ -5,6 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert } from 'chai'; import { TEST_REPOS_MAP } from '../testMatrix.js'; @@ -19,7 +20,7 @@ context('deploy metadata --metadata NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); // some deploys reference other metadata not included in the deploy, if it's not already in the org it will fail const args = testkit.packageNames.map((p) => `--source-dir ${p}`).join(' '); diff --git a/test/nuts/seeds/deploy.metadata.source-dir.seed.ts b/test/nuts/seeds/deploy.metadata.source-dir.seed.ts index 7da38916..afc3ef5f 100644 --- a/test/nuts/seeds/deploy.metadata.source-dir.seed.ts +++ b/test/nuts/seeds/deploy.metadata.source-dir.seed.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { assert } from 'chai'; import { SourceTestkit } from '@salesforce/source-testkit'; import { TEST_REPOS_MAP } from '../testMatrix.js'; @@ -20,7 +21,7 @@ context('deploy metadata --source-dir NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/nuts/seeds/deploy.metadata.test-level.seed.ts b/test/nuts/seeds/deploy.metadata.test-level.seed.ts index 2d0b3849..494d511d 100644 --- a/test/nuts/seeds/deploy.metadata.test-level.seed.ts +++ b/test/nuts/seeds/deploy.metadata.test-level.seed.ts @@ -7,6 +7,7 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, expect } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; @@ -22,7 +23,7 @@ context('deploy metadata --test-level NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); const args = testkit.packageNames.map((p) => `--source-dir ${p}`).join(' '); diff --git a/test/nuts/specialTypes/customLabels.nut.ts b/test/nuts/specialTypes/customLabels.nut.ts index d3a0c059..146b7c02 100644 --- a/test/nuts/specialTypes/customLabels.nut.ts +++ b/test/nuts/specialTypes/customLabels.nut.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; context('deploy metadata CustomLabels NUTs', () => { @@ -14,7 +15,7 @@ context('deploy metadata CustomLabels NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); });