Skip to content

Commit f7cd018

Browse files
author
github-actions
committed
chore: self mutation
Signed-off-by: github-actions <github-actions@github.com>
1 parent f69b420 commit f7cd018

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/@aws-cdk/toolkit-lib/test/util/network-detector.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('NetworkDetector', () => {
3030
end: jest.fn(),
3131
destroy: jest.fn(),
3232
};
33-
33+
3434
mockRequest.mockImplementation((_options, callback) => {
3535
callback({ statusCode: 200 });
3636
return mockReq;
@@ -50,7 +50,7 @@ describe('NetworkDetector', () => {
5050
end: jest.fn(),
5151
destroy: jest.fn(),
5252
};
53-
53+
5454
mockRequest.mockImplementation((_options, callback) => {
5555
callback({ statusCode: 500 });
5656
return mockReq;
@@ -74,7 +74,7 @@ describe('NetworkDetector', () => {
7474
end: jest.fn(),
7575
destroy: jest.fn(),
7676
};
77-
77+
7878
mockRequest.mockReturnValue(mockReq);
7979
mockFs.existsSync.mockReturnValue(false);
8080

@@ -92,7 +92,7 @@ describe('NetworkDetector', () => {
9292
(mockFs.readJSON as jest.Mock).mockResolvedValue(cachedData);
9393

9494
const result = await NetworkDetector.hasConnectivity();
95-
95+
9696
expect(result).toBe(true); // Should return cached connectivity result
9797
expect(mockRequest).not.toHaveBeenCalled(); // Should not make network request when cache is valid
9898
});
@@ -108,7 +108,7 @@ describe('NetworkDetector', () => {
108108
end: jest.fn(),
109109
destroy: jest.fn(),
110110
};
111-
111+
112112
mockRequest.mockImplementation((_options, callback) => {
113113
callback({ statusCode: 200 });
114114
return mockReq;
@@ -120,7 +120,7 @@ describe('NetworkDetector', () => {
120120
(mockFs.writeJSON as jest.Mock).mockResolvedValue(undefined);
121121

122122
const result = await NetworkDetector.hasConnectivity();
123-
123+
124124
expect(result).toBe(true); // Should return fresh connectivity result
125125
expect(mockRequest).toHaveBeenCalledTimes(1); // Should make network request when cache is expired
126126
});
@@ -131,7 +131,7 @@ describe('NetworkDetector', () => {
131131
end: jest.fn(),
132132
destroy: jest.fn(),
133133
};
134-
134+
135135
mockRequest.mockImplementation((_options, callback) => {
136136
callback({ statusCode: 200 });
137137
return mockReq;
@@ -141,7 +141,7 @@ describe('NetworkDetector', () => {
141141
(mockFs.ensureFile as jest.Mock).mockRejectedValue(new Error('Disk full'));
142142

143143
const result = await NetworkDetector.hasConnectivity();
144-
144+
145145
expect(result).toBe(true); // Should still return connectivity result despite cache save failure
146146
});
147147

@@ -151,7 +151,7 @@ describe('NetworkDetector', () => {
151151
end: jest.fn(),
152152
destroy: jest.fn(),
153153
};
154-
154+
155155
mockRequest.mockImplementation((_options, callback) => {
156156
callback({ statusCode: 200 });
157157
return mockReq;
@@ -163,7 +163,7 @@ describe('NetworkDetector', () => {
163163
(mockFs.writeJSON as jest.Mock).mockResolvedValue(undefined);
164164

165165
const result = await NetworkDetector.hasConnectivity();
166-
166+
167167
expect(result).toBe(true); // Should still return connectivity result despite cache load failure
168168
});
169169
});

packages/aws-cdk/test/cli/telemetry/sink/funnel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import * as https from 'https';
22
import * as os from 'os';
33
import * as path from 'path';
4+
import { NetworkDetector } from '@aws-cdk/toolkit-lib';
45
import * as fs from 'fs-extra';
56
import { createTestEvent } from './util';
67
import { IoHelper } from '../../../../lib/api-private';
78
import { CliIoHost } from '../../../../lib/cli/io-host';
89
import { EndpointTelemetrySink } from '../../../../lib/cli/telemetry/sink/endpoint-sink';
910
import { FileTelemetrySink } from '../../../../lib/cli/telemetry/sink/file-sink';
1011
import { Funnel } from '../../../../lib/cli/telemetry/sink/funnel';
11-
import { NetworkDetector } from '@aws-cdk/toolkit-lib';
1212

1313
// Mock the https module
1414
jest.mock('https', () => ({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { NetworkDetector } from '@aws-cdk/toolkit-lib';
12
import * as nock from 'nock';
23
import { exec } from '../../lib/cli/cli';
3-
import { NetworkDetector } from '@aws-cdk/toolkit-lib';
44

55
// Mock NetworkDetector
66
jest.mock('@aws-cdk/toolkit-lib', () => ({
@@ -30,7 +30,7 @@ const BASIC_NOTICE = {
3030
beforeEach(() => {
3131
nock.cleanAll();
3232
jest.clearAllMocks();
33-
33+
3434
// Mock NetworkDetector to return true by default for all tests
3535
(NetworkDetector.hasConnectivity as jest.Mock).mockResolvedValue(true);
3636
});

0 commit comments

Comments
 (0)