Skip to content

Commit 2f7e4b0

Browse files
committed
chore: changes after review
1 parent 5dff470 commit 2f7e4b0

File tree

8 files changed

+46
-14
lines changed

8 files changed

+46
-14
lines changed

.github/workflows/smoke.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,34 @@ jobs:
182182
node-version: 18
183183
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"
184184

185+
run-smoke--npm--node-22--windows:
186+
needs: prepare-smoke
187+
runs-on: windows-latest
188+
steps:
189+
- uses: actions/cache@v3
190+
with:
191+
path: __tests__/smoke/
192+
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
193+
enableCrossOsArchive: true
194+
- uses: actions/setup-node@v3
195+
with:
196+
node-version: 22
197+
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run"
198+
199+
run-smoke--yarn--node-22--windows:
200+
needs: prepare-smoke
201+
runs-on: windows-latest
202+
steps:
203+
- uses: actions/cache@v3
204+
with:
205+
path: __tests__/smoke/
206+
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
207+
enableCrossOsArchive: true
208+
- uses: actions/setup-node@v3
209+
with:
210+
node-version: 22
211+
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"
212+
185213
run-smoke--npm--node-18--windows:
186214
needs: prepare-smoke
187215
runs-on: windows-latest

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"engines": {
77
"node": ">=18.17.0",
8-
"npm": ">=7.0.0"
8+
"npm": ">=10.8.2"
99
},
1010
"engineStrict": true,
1111
"scripts": {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"engines": {
1111
"node": ">=18.17.0",
12-
"npm": ">=7.0.0"
12+
"npm": ">=10.8.2"
1313
},
1414
"engineStrict": true,
1515
"scripts": {

packages/cli/src/__tests__/commands/push.test.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import { ConfigFixture } from '../fixtures/config';
66
import { yellow } from 'colorette';
77
import { Readable } from 'node:stream';
88

9-
jest.mock('fs');
10-
jest.mock('@redocly/openapi-core');
11-
jest.mock('../../utils/miscellaneous');
12-
139
// Mock fs operations
1410
jest.mock('fs', () => ({
1511
...jest.requireActual('fs'),
@@ -25,6 +21,9 @@ jest.mock('fs', () => ({
2521
readdirSync: jest.fn(() => []),
2622
}));
2723

24+
jest.mock('@redocly/openapi-core');
25+
jest.mock('../../utils/miscellaneous');
26+
2827
// Mock fetch
2928
const mockFetch = jest.fn(() =>
3029
Promise.resolve({
@@ -46,7 +45,7 @@ const mockFetch = jest.fn(() =>
4645
} as Response)
4746
);
4847

49-
global.fetch = mockFetch;
48+
const originalFetch = global.fetch;
5049

5150
(getMergedConfig as jest.Mock).mockImplementation((config) => config);
5251

@@ -55,12 +54,17 @@ describe('push', () => {
5554

5655
beforeEach(() => {
5756
jest.spyOn(process.stdout, 'write').mockImplementation(() => true);
57+
global.fetch = mockFetch;
5858
});
5959

6060
afterEach(() => {
6161
mockFetch.mockClear();
6262
});
6363

64+
afterAll(() => {
65+
global.fetch = originalFetch;
66+
});
67+
6468
it('pushes definition', async () => {
6569
await handlePush({
6670
argv: {

packages/cli/src/cms/api/api-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import fetchWithTimeout, {
55
} from '../../utils/fetch-with-timeout';
66

77
import type { ReadStream } from 'fs';
8+
import type { Readable } from 'node:stream';
89
import type {
910
ListRemotesResponse,
1011
ProjectSourceResponse,
1112
PushResponse,
1213
UpsertRemoteResponse,
1314
} from './types';
14-
import type { Readable } from 'stream';
1515

1616
interface BaseApiClient {
1717
request(url: string, options: FetchWithTimeoutOptions): Promise<Response>;

packages/cli/src/commands/push.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import { promptClientToken } from './login';
2323
import { handlePush as handleCMSPush } from '../cms/commands/push';
2424
import { streamToBuffer } from '../cms/api/api-client';
2525

26+
import type { Readable } from 'node:stream';
27+
import type { Agent } from 'node:http';
2628
import type { Config, BundleOutputFormat, Region } from '@redocly/openapi-core';
2729
import type { CommandArgs } from '../wrapper';
2830
import type { VerifyConfigOptions } from '../types';
29-
import type { Readable } from 'node:stream';
30-
import type { Agent } from 'node:http';
3131

3232
const DEFAULT_VERSION = 'latest';
3333

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "lib/index.js",
66
"engines": {
77
"node": ">=18.17.0",
8-
"npm": ">=7.0.0"
8+
"npm": ">=10.8.2"
99
},
1010
"engineStrict": true,
1111
"license": "MIT",

0 commit comments

Comments
 (0)