Skip to content

Commit 4fc01f6

Browse files
committed
test: update
1 parent c12960f commit 4fc01f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/aws-cdk/test/commands/init.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import * as child_process from 'child_process';
12
import * as os from 'os';
23
import * as path from 'path';
34
import * as cxapi from '@aws-cdk/cx-api';
45
import * as fs from 'fs-extra';
56
import { availableInitLanguages, availableInitTemplates, cliInit, currentlyRecommendedAwsCdkLibFlags, expandPlaceholders, printAvailableTemplates } from '../../lib/commands/init';
7+
import type { JsPackageManager } from '../../lib/commands/init/package-manager';
68
import { createSingleLanguageTemplate, createMultiLanguageTemplate, createMultiTemplateRepository } from '../_fixtures/init-templates/template-helpers';
79
import { TestIoHost } from '../_helpers/io-host';
8-
import { JsPackageManager } from '../../lib/commands/init/package-manager';
910

1011
const ioHost = new TestIoHost();
1112
const ioHelper = ioHost.asHelper('init');
@@ -1343,12 +1344,11 @@ describe('constructs version', () => {
13431344
describe('package-manager option', () => {
13441345
let spawnSpy: jest.SpyInstance;
13451346

1346-
beforeEach(() => {
1347+
beforeEach(async () => {
13471348
// Mock child_process.spawn to track which package manager is called
1348-
spawnSpy = jest.spyOn(require('child_process'), 'spawn').mockImplementation(() => ({
1349+
spawnSpy = jest.spyOn(child_process, 'spawn').mockImplementation(() => ({
13491350
stdout: { on: jest.fn() },
1350-
stderr: { on: jest.fn() },
1351-
}));
1351+
}) as unknown as child_process.ChildProcess);
13521352
});
13531353

13541354
afterEach(() => {

0 commit comments

Comments
 (0)