Skip to content

Commit 2343a11

Browse files
committed
fix: test fixes
1 parent c7d8cd3 commit 2343a11

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/configMeta.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { spawnSync } from 'node:child_process';
8+
// eslint-disable-next-line @typescript-eslint/no-var-requires
9+
const childProcess = require('node:child_process') as typeof import('node:child_process');
910
import { ConfigValue, Messages } from '@salesforce/core';
1011

1112
Messages.importMessagesDirectory(__dirname);
@@ -26,7 +27,7 @@ export default [
2627
hidden: false,
2728
input: {
2829
validator: (value: ConfigValue): boolean => {
29-
const result = spawnSync('sf', ['force:org:display', '-u', value as string]);
30+
const result = childProcess.spawnSync('sf', ['force:org:display', '-u', value as string]);
3031
return result.status === 0;
3132
},
3233
failedMessage: (value: ConfigValue): string =>

test/commands/devops/project/list.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('devops project list', () => {
8383
.command(['devops:project:list', '--target-org', 'testOrg'])
8484
.catch(() => {})
8585
.it('shows DevOps Center not enabled error', (ctx) => {
86-
expect(ctx.stderr).to.contain('DevOps Center is not enabled');
86+
expect(ctx.stderr).to.contain("DevOps Center isn't enabled");
8787
});
8888
});
8989

test/commands/devops/work-item/create.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('devops work-item create', () => {
125125
])
126126
.catch(() => {})
127127
.it('shows DevOps Center not enabled error', (ctx) => {
128-
expect(ctx.stderr).to.contain('DevOps Center is not enabled');
128+
expect(ctx.stderr).to.contain("DevOps Center isn't enabled");
129129
});
130130
});
131131

test/commands/devops/work-item/list.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('devops work-item list', () => {
7575
.command(['devops:work-item:list', '--target-org', 'testOrg', '--project-id', '1Qg000000000001'])
7676
.catch(() => {})
7777
.it('shows DevOps Center not enabled error', (ctx) => {
78-
expect(ctx.stderr).to.contain('DevOps Center is not enabled');
78+
expect(ctx.stderr).to.contain("DevOps Center isn't enabled");
7979
});
8080
});
8181

test/configMeta.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import * as spawnSync from 'node:child_process';
8+
// eslint-disable-next-line @typescript-eslint/no-var-requires
9+
const spawnSync = require('node:child_process') as typeof import('node:child_process');
910
import { expect } from '@oclif/test';
1011
import * as sinon from 'sinon';
1112
import configMeta from '../src/configMeta';

0 commit comments

Comments
 (0)