Skip to content

Commit 55d047d

Browse files
committed
Remove test assertions redundant with TypeScript static analysis
Drop assertions that merely verify unset optional properties are undefined (a JavaScript language guarantee) and a second test block whose only runtime value was re-checking literals just assigned to typed variables. TypeScript's compiler already validates that these object literals conform to the declared union types.
1 parent a48eb96 commit 55d047d

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

src/__tests__/metro-protocol-public.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {
44
buildBundleUrl,
55
normalizeBaseUrl,
66
type MetroBridgeDescriptor,
7-
type MetroTunnelRequestMessage,
8-
type MetroTunnelResponseMessage,
97
} from '../metro.ts';
108

119
test('public metro exports expose stable bridge payload types and url helpers', () => {
@@ -33,32 +31,9 @@ test('public metro exports expose stable bridge payload types and url helpers',
3331
},
3432
};
3533

36-
assert.equal(descriptor.upstream.port, undefined);
37-
assert.equal(descriptor.status_url, undefined);
3834
assert.equal(normalizeBaseUrl('https://bridge.example.test///'), 'https://bridge.example.test');
3935
assert.equal(
4036
buildBundleUrl('https://bridge.example.test/', 'ios'),
4137
'https://bridge.example.test/index.bundle?platform=ios&dev=true&minify=false',
4238
);
4339
});
44-
45-
test('public metro exports compile for representative tunnel request and response payloads', () => {
46-
const request: MetroTunnelRequestMessage = {
47-
type: 'ws-frame',
48-
streamId: 'stream-1',
49-
dataBase64: 'aGVsbG8=',
50-
binary: false,
51-
};
52-
const response: MetroTunnelResponseMessage = {
53-
type: 'http-response',
54-
requestId: 'req-1',
55-
status: 200,
56-
headers: { 'content-type': 'application/json' },
57-
};
58-
59-
const messages = [request, response];
60-
61-
assert.equal(request.type, 'ws-frame');
62-
assert.equal(response.type, 'http-response');
63-
assert.equal(messages.length, 2);
64-
});

0 commit comments

Comments
 (0)