Skip to content

Commit cc24dc6

Browse files
committed
Restore missing-href scenario in asset-proxy test
The TS test conversion (#1095) added href: '' to the 'handles assets without href' test to satisfy the Assets type, which turned it into a with-empty-href test that no longer matched its name. Provide an asset genuinely missing href (via a cast) so it exercises the intended missing-href branch of getProxiedAssets.
1 parent abd8ae6 commit cc24dc6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/unit/test-asset-proxy.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,13 @@ test('AssetProxy - getProxiedAssets() handles assets without href', async (t) =>
202202
process.env['ASSET_PROXY_BUCKET_OPTION'] = 'ALL'
203203

204204
const proxy = await AssetProxy.create()
205-
const assets: Assets = {
205+
// Deliberately omit `href` to exercise the missing-href branch; cast because
206+
// the Assets type requires href.
207+
const assets = {
206208
metadata: {
207-
href: '',
208209
type: 'application/xml'
209210
}
210-
}
211+
} as unknown as Assets
211212

212213
const { assets: proxied, wasProxied } = proxy.getProxiedAssets(
213214
assets,
@@ -217,7 +218,7 @@ test('AssetProxy - getProxiedAssets() handles assets without href', async (t) =>
217218
)
218219

219220
t.false(wasProxied)
220-
t.deepEqual(proxied['metadata'], { href: '', type: 'application/xml' })
221+
t.deepEqual(proxied['metadata'], { type: 'application/xml' })
221222
} finally {
222223
process.env = before
223224
}

0 commit comments

Comments
 (0)