Skip to content

Commit d9312d2

Browse files
committedApr 8, 2025··
Drop now-unnecessary manual decode step in tests
Unnecessary because decoding is now shortcircuited for the simple case, so it runs sync.
1 parent d5a6b1c commit d9312d2

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed
 

Diff for: ‎test/unit/model/filters/search-filter-integration.spec.ts

-18
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ function getSuggestionDescriptions(input: string) {
5454
);
5555
}
5656

57-
async function decodeBodies(events: CollectedEvent[]) {
58-
events.forEach(e => {
59-
if (e.isHttp()) {
60-
e.request.body.decodedData;
61-
if (e.isSuccessfulExchange()) e.response.body.decodedData;
62-
}
63-
});
64-
await delay(1);
65-
}
66-
6757
describe("Search filter model integration test:", () => {
6858
describe("Simple filter usage", () => {
6959
it("should suggest all filter names given no input", () => {
@@ -1107,8 +1097,6 @@ describe("Search filter model integration test:", () => {
11071097
getExchangeData({ requestBody: '', responseBody: 'very-big-response' })
11081098
];
11091099

1110-
await decodeBodies(exampleEvents);
1111-
11121100
const matchedEvents = exampleEvents.filter(e =>
11131101
filter.matches(e)
11141102
) as HttpExchange[];
@@ -1147,8 +1135,6 @@ describe("Search filter model integration test:", () => {
11471135
getExchangeData({ requestBody: '', responseBody: 'very-big-response' })
11481136
];
11491137

1150-
await decodeBodies(exampleEvents);
1151-
11521138
const matchedEvents = exampleEvents.filter(e =>
11531139
filter.matches(e)
11541140
) as HttpExchange[];
@@ -1243,10 +1229,6 @@ describe("Search filter model integration test:", () => {
12431229
filter.matches(e)
12441230
) as HttpExchange[];
12451231

1246-
// We filter without decoding - just useful here to get the data itself
1247-
// to assert on afterwards:
1248-
await decodeBodies(matchedEvents);
1249-
12501232
expect(
12511233
matchedEvents.map((e) =>
12521234
e.request.body.decodedData?.toString('utf8') + ':' +

0 commit comments

Comments
 (0)
Please sign in to comment.