|
| 1 | +import * as child_process from 'child_process'; |
1 | 2 | import * as os from 'os'; |
2 | 3 | import * as path from 'path'; |
3 | 4 | import * as cxapi from '@aws-cdk/cx-api'; |
4 | 5 | import * as fs from 'fs-extra'; |
5 | 6 | import { availableInitLanguages, availableInitTemplates, cliInit, currentlyRecommendedAwsCdkLibFlags, expandPlaceholders, printAvailableTemplates } from '../../lib/commands/init'; |
| 7 | +import type { JsPackageManager } from '../../lib/commands/init/package-manager'; |
6 | 8 | import { createSingleLanguageTemplate, createMultiLanguageTemplate, createMultiTemplateRepository } from '../_fixtures/init-templates/template-helpers'; |
7 | 9 | import { TestIoHost } from '../_helpers/io-host'; |
8 | | -import { JsPackageManager } from '../../lib/commands/init/package-manager'; |
9 | 10 |
|
10 | 11 | const ioHost = new TestIoHost(); |
11 | 12 | const ioHelper = ioHost.asHelper('init'); |
@@ -1343,12 +1344,11 @@ describe('constructs version', () => { |
1343 | 1344 | describe('package-manager option', () => { |
1344 | 1345 | let spawnSpy: jest.SpyInstance; |
1345 | 1346 |
|
1346 | | - beforeEach(() => { |
| 1347 | + beforeEach(async () => { |
1347 | 1348 | // 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(() => ({ |
1349 | 1350 | stdout: { on: jest.fn() }, |
1350 | | - stderr: { on: jest.fn() }, |
1351 | | - })); |
| 1351 | + }) as unknown as child_process.ChildProcess); |
1352 | 1352 | }); |
1353 | 1353 |
|
1354 | 1354 | afterEach(() => { |
|
0 commit comments