Skip to content

Commit

Permalink
chore: __filename
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Nov 13, 2023
1 parent d5874b3 commit 5e85a40
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 16 deletions.
3 changes: 2 additions & 1 deletion test/commands/deploy.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/commands/deploy/metadata.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/commands/deploy/metadata/quick.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/commands/deploy/metadata/report-mdapi.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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({
Expand Down
3 changes: 2 additions & 1 deletion test/commands/deploy/metadata/report.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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') }],
});
});
Expand Down
3 changes: 2 additions & 1 deletion test/commands/deploy/metadata/resume.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/commands/deploy/metadata/validate.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/nuts/delete/source.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 });
Expand Down
3 changes: 2 additions & 1 deletion test/nuts/destructive/destructiveChanges.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 });
Expand Down
3 changes: 2 additions & 1 deletion test/nuts/retrieve/metadata.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 });
Expand Down
3 changes: 2 additions & 1 deletion test/nuts/seeds/deploy.metadata.manifest.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(' ');
Expand Down
3 changes: 2 additions & 1 deletion test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/nuts/seeds/deploy.metadata.metadata.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(' ');
Expand Down
3 changes: 2 additions & 1 deletion test/nuts/seeds/deploy.metadata.source-dir.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/nuts/seeds/deploy.metadata.test-level.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(' ');
Expand Down
3 changes: 2 additions & 1 deletion test/nuts/specialTypes/customLabels.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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),
});
});

Expand Down

0 comments on commit 5e85a40

Please sign in to comment.