Skip to content

Commit f04ea42

Browse files
committed
fix CI issue
1 parent db20d1c commit f04ea42

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/download/downloadCommand.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ import tmp from "tmp";
1010
import chai from "chai";
1111
import chaiFs from "chai-fs";
1212
import { DownloadCommand } from "./downloadCommand";
13+
import _ from "lodash";
1314

1415
chai.use(chaiFs);
1516

1617
// eslint-disable-next-line @typescript-eslint/no-var-requires
1718
const assetSearchResults = require("../../testResources/download/resources/assetSearch.json");
1819

1920
// eslint-disable-next-line @typescript-eslint/no-var-requires
20-
const asset = require("../../testResources/download/resources/getAsset");
21+
const assetResource = require("../../testResources/download/resources/getAsset");
22+
// Create a local copy to avoid mutating shared test resources that other tests depend on
23+
const asset = _.cloneDeep(assetResource);
2124
// Use a shorter URL for better readability
2225
asset.files.find((file) => file.classifier === "fat-raml").externalLink =
2326
"https://short.url/raml.zip";
@@ -66,7 +69,11 @@ function setup({
6669
// Intercept searchExchange request
6770
.nock("https://anypoint.mulesoft.com/exchange/api/v2", (scope) =>
6871
scope
69-
.get(`/assets?search=${encodeURIComponent(search)}&types=rest-api`)
72+
.get(
73+
`/assets?search=${encodeURIComponent(
74+
search
75+
)}&types=rest-api&limit=50&offset=0`
76+
)
7077
.reply(200, [assetSearchResults[0]])
7178
)
7279
// Intercept search requests

src/download/exchangeDownloader.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ describe("exchangeDownloader", () => {
339339
.reply(200, [assetSearchResults[0]]);
340340
});
341341

342+
afterEach(() => {
343+
// Clean up any remaining nock interceptors for this describe block
344+
nock.cleanAll();
345+
});
346+
342347
it("searches Exchange and filters by deployment", () => {
343348
scope
344349
.get("/shop-products-categories-api-v1")

src/download/exchangeDownloaderMultipleVersions.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ describe("exchangeDownloaderMultipleVersions", () => {
166166
.reply(200, [assetSearchResults[0]]);
167167
});
168168

169+
afterEach(() => {
170+
// Clean up any remaining nock interceptors for this describe block
171+
nock.cleanAll();
172+
});
173+
169174
it("searches Exchange and filters by latest version", () => {
170175
scope
171176
.get("/shop-products-categories-api-v1")

0 commit comments

Comments
 (0)