diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index 96ee926ff..40427e50c 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -182,6 +182,34 @@ jobs: node-version: 18 - run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn" + run-smoke--npm--node-22--windows: + needs: prepare-smoke + runs-on: windows-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + enableCrossOsArchive: true + - uses: actions/setup-node@v3 + with: + node-version: 22 + - run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run" + + run-smoke--yarn--node-22--windows: + needs: prepare-smoke + runs-on: windows-latest + steps: + - uses: actions/cache@v3 + with: + path: __tests__/smoke/ + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + enableCrossOsArchive: true + - uses: actions/setup-node@v3 + with: + node-version: 22 + - run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn" + run-smoke--npm--node-18--windows: needs: prepare-smoke runs-on: windows-latest diff --git a/package-lock.json b/package-lock.json index fb7c8ddb8..caa40fda2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ }, "engines": { "node": ">=18.17.0", - "npm": ">=7.0.0" + "npm": ">=10.8.2" } }, "node_modules/@ampproject/remapping": { @@ -12589,7 +12589,7 @@ }, "engines": { "node": ">=18.17.0", - "npm": ">=7.0.0" + "npm": ">=10.8.2" } }, "packages/cli/node_modules/form-data": { @@ -12630,7 +12630,7 @@ }, "engines": { "node": ">=18.17.0", - "npm": ">=7.0.0" + "npm": ">=10.8.2" } }, "packages/core/node_modules/agent-base": { diff --git a/package.json b/package.json index 2040051d8..9d07e7c06 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "private": true, "engines": { "node": ">=18.17.0", - "npm": ">=7.0.0" + "npm": ">=10.8.2" }, "engineStrict": true, "scripts": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 4e30dd6b4..5327d4d68 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -9,7 +9,7 @@ }, "engines": { "node": ">=18.17.0", - "npm": ">=7.0.0" + "npm": ">=10.8.2" }, "engineStrict": true, "scripts": { diff --git a/packages/cli/src/__tests__/commands/push.test.ts b/packages/cli/src/__tests__/commands/push.test.ts index 14a88d3ed..c0ecba491 100644 --- a/packages/cli/src/__tests__/commands/push.test.ts +++ b/packages/cli/src/__tests__/commands/push.test.ts @@ -6,10 +6,6 @@ import { ConfigFixture } from '../fixtures/config'; import { yellow } from 'colorette'; import { Readable } from 'node:stream'; -jest.mock('fs'); -jest.mock('@redocly/openapi-core'); -jest.mock('../../utils/miscellaneous'); - // Mock fs operations jest.mock('fs', () => ({ ...jest.requireActual('fs'), @@ -25,6 +21,9 @@ jest.mock('fs', () => ({ readdirSync: jest.fn(() => []), })); +jest.mock('@redocly/openapi-core'); +jest.mock('../../utils/miscellaneous'); + // Mock fetch const mockFetch = jest.fn(() => Promise.resolve({ @@ -46,7 +45,7 @@ const mockFetch = jest.fn(() => } as Response) ); -global.fetch = mockFetch; +const originalFetch = global.fetch; (getMergedConfig as jest.Mock).mockImplementation((config) => config); @@ -55,12 +54,17 @@ describe('push', () => { beforeEach(() => { jest.spyOn(process.stdout, 'write').mockImplementation(() => true); + global.fetch = mockFetch; }); afterEach(() => { mockFetch.mockClear(); }); + afterAll(() => { + global.fetch = originalFetch; + }); + it('pushes definition', async () => { await handlePush({ argv: { diff --git a/packages/cli/src/cms/api/api-client.ts b/packages/cli/src/cms/api/api-client.ts index ec87c9b5f..4578ae287 100644 --- a/packages/cli/src/cms/api/api-client.ts +++ b/packages/cli/src/cms/api/api-client.ts @@ -5,13 +5,13 @@ import fetchWithTimeout, { } from '../../utils/fetch-with-timeout'; import type { ReadStream } from 'fs'; +import type { Readable } from 'node:stream'; import type { ListRemotesResponse, ProjectSourceResponse, PushResponse, UpsertRemoteResponse, } from './types'; -import type { Readable } from 'stream'; interface BaseApiClient { request(url: string, options: FetchWithTimeoutOptions): Promise; diff --git a/packages/cli/src/commands/push.ts b/packages/cli/src/commands/push.ts index 68f1e9542..bfb928669 100644 --- a/packages/cli/src/commands/push.ts +++ b/packages/cli/src/commands/push.ts @@ -23,11 +23,11 @@ import { promptClientToken } from './login'; import { handlePush as handleCMSPush } from '../cms/commands/push'; import { streamToBuffer } from '../cms/api/api-client'; +import type { Readable } from 'node:stream'; +import type { Agent } from 'node:http'; import type { Config, BundleOutputFormat, Region } from '@redocly/openapi-core'; import type { CommandArgs } from '../wrapper'; import type { VerifyConfigOptions } from '../types'; -import type { Readable } from 'node:stream'; -import type { Agent } from 'node:http'; const DEFAULT_VERSION = 'latest'; diff --git a/packages/core/package.json b/packages/core/package.json index f30775301..f3871d67e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "engines": { "node": ">=18.17.0", - "npm": ">=7.0.0" + "npm": ">=10.8.2" }, "engineStrict": true, "license": "MIT",