Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

9 changes: 0 additions & 9 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'eslint-config-salesforce-typescript';
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.3.34",
"@salesforce/cli-plugins-testkit": "^5.3.64",
"@salesforce/dev-scripts": "^11.0.4",
"@salesforce/dev-scripts": "^13.0.1",
"@salesforce/plugin-command-reference": "^3.1.125",
"@salesforce/ts-sinon": "^1.4.36",
"@salesforce/ts-types": "^3.0.1",
"@types/marked": "^4.0.8",
"@types/marked-terminal": "^3.1.3",
"@types/semver": "^7.8.0",
"@types/sinon-chai": "^3.2.12",
"eslint": "^10.4.0",
"eslint-config-salesforce-typescript": "^6.0.0",
"eslint-plugin-sf-plugin": "^1.20.33",
"oclif": "^4.23.29",
"sinon-chai": "^3.7.0",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
"typescript": "^5.5.4 || ^6"
},
"resolutions": {
"@jsforce/jsforce-node/node-fetch/whatwg-url": "^14.0.0"
Expand Down Expand Up @@ -146,6 +148,7 @@
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/eslint.config.*",
"**/.eslint*",
"**/tsconfig.json"
],
Expand Down
4 changes: 2 additions & 2 deletions src/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class Diagnostics {
const conn = new Connection();
await conn.request(url);
await Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: `can access: ${url}`, status: 'pass' });
} catch (e) {
} catch {
await Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: `can't access: ${url}`, status: 'fail' });
this.doctor.addSuggestion(
`Cannot reach ${url} - potential network configuration error, check proxies, firewalls, environment variables`
Expand All @@ -163,7 +163,7 @@ export class Diagnostics {
testName: `can access: ${manifestUrl}`,
status: 'pass',
});
} catch (e) {
} catch {
await Lifecycle.getInstance().emit('Doctor:diagnostic', {
testName: `can't access: ${manifestUrl}`,
status: 'fail',
Expand Down
25 changes: 0 additions & 25 deletions test/.eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion test/commands/doctor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
return cmd.run();
};

beforeEach(async () => {

Check failure on line 156 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'beforeEach'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 156 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'beforeEach'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
fsExistsSyncStub = stubMethod(sandbox, fs, 'existsSync');
fsMkdirSyncStub = stubMethod(sandbox, fs, 'mkdirSync');
fsWriteFileSyncStub = stubMethod(sandbox, fs, 'writeFileSync');
Expand All @@ -167,10 +167,10 @@
stubMethod(sandbox, Doctor.prototype, 'closeStderr');
});

afterEach(() => {

Check failure on line 170 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'afterEach'.

Check failure on line 170 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'afterEach'.
sandbox.restore();
// Reset the instance for testing
// eslint-disable-next-line @typescript-eslint/ban-ts-comment,@typescript-eslint/no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete Doctor.instance;
});
Expand Down Expand Up @@ -213,7 +213,7 @@
});
};

it('runs doctor command with no flags', async () => {

Check failure on line 216 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 216 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const suggestion = 'work smarter, not faster';
fsExistsSyncStub.returns(true);
const diagnosticStatus = { testName: 'doctor test', status: 'pass' };
Expand Down Expand Up @@ -248,7 +248,7 @@
]);
});

it('reports on uppercase and lowercase proxy env vars', async () => {

Check failure on line 251 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 251 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const httpProxyEnv = ['http_proxy', 'test.http.proxy'];
const httpsProxyEnv = ['HTTPS_PROXY', 'test.HTTPS.proxy'];
const noProxyEnv = ['no_proxy', 'test.blah.com'];
Expand Down Expand Up @@ -276,7 +276,7 @@
}
});

it('runs doctor command with outputdir flag (existing dir)', async () => {

Check failure on line 279 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 279 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const outputdir = path.resolve('foo', 'bar', 'test');
fsExistsSyncStub.returns(true);
Doctor.init(oclifConfig);
Expand Down Expand Up @@ -305,7 +305,7 @@
]);
});

it('runs doctor command with outputdir flag (non-existing dir)', async () => {

Check failure on line 308 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 308 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const outputdir = path.resolve('foo', 'bar', 'test');
fsExistsSyncStub.returns(false);
Doctor.init(oclifConfig);
Expand Down Expand Up @@ -334,7 +334,7 @@
]);
});

it('runs doctor command with command flag (minimal)', async () => {

Check failure on line 337 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 337 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const cmd = 'force:org:list --all';
const expectedCmd = `${oclifConfig.bin} ${cmd} --dev-debug`;
fsExistsSyncStub.returns(true);
Expand Down Expand Up @@ -369,7 +369,7 @@
expect(result).to.have.property('commandName', expectedCmd);
});

it('runs doctor command with command flag (full)', async () => {

Check failure on line 372 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 372 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const cmd = `${oclifConfig.bin} force:org:list --all --dev-debug`;
fsExistsSyncStub.returns(true);
Doctor.init(oclifConfig);
Expand Down Expand Up @@ -404,7 +404,7 @@
expect(result).to.have.property('commandName', cmd);
});

it('runs doctor command with plugin flag', async () => {

Check failure on line 407 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 407 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
fsExistsSyncStub.returns(true);
Doctor.init(oclifConfig);
diagnosticsRunStub.callsFake(() => [Promise.resolve()]);
Expand All @@ -429,7 +429,7 @@
expect(runHookStub.args).to.deep.equal([['sf-doctor-@salesforce/plugin-org']]);
});

it('runs doctor command with plugin flag (no plugin tests)', async () => {

Check failure on line 432 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

Check failure on line 432 in test/commands/doctor.test.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.19.0)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
fsExistsSyncStub.returns(true);
const versionDetail = getVersionDetailStub();
// @ts-expect-error: stubbing a private property
Expand Down
2 changes: 1 addition & 1 deletion test/diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Diagnostics', () => {
afterEach(() => {
sandbox.restore();
// Reset the instance for testing
// eslint-disable-next-line @typescript-eslint/ban-ts-comment,@typescript-eslint/no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete Doctor.instance;
});
Expand Down
2 changes: 1 addition & 1 deletion test/doctor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('Doctor Class', () => {
afterEach(() => {
sandbox.restore();
// Reset the instance for testing
// eslint-disable-next-line @typescript-eslint/ban-ts-comment,@typescript-eslint/no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete Doctor.instance;
});
Expand Down
2 changes: 1 addition & 1 deletion test/shared/getInfoConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('getInfoConfig tests', () => {
},
},
},
} as PjsonWithInfo;
};

// keep pjsonMock as JSON to access values in tests
readFileStub = stubMethod(sandbox, fs.promises, 'readFile').resolves(JSON.stringify(pjsonMock));
Expand Down
Loading
Loading