23 lines
940 B
TypeScript
23 lines
940 B
TypeScript
import { strict as assert } from 'node:assert'
|
|
import { test } from 'node:test'
|
|
import { bridgeArtifact, jetsonBridgeImage, localBridgeImage } from './bridgeArtifacts'
|
|
|
|
test('PC and Jetson bridges have separate pinned downloads', () => {
|
|
const pc = bridgeArtifact(localBridgeImage)!
|
|
const jetson = bridgeArtifact(jetsonBridgeImage)!
|
|
assert.equal(pc.architecture, 'amd64')
|
|
assert.equal(jetson.architecture, 'arm64')
|
|
assert.notEqual(pc.url, jetson.url)
|
|
assert.notEqual(pc.fileName, jetson.fileName)
|
|
for (const artifact of [pc, jetson]) {
|
|
assert.match(artifact.checksumSha256, /^[a-f0-9]{64}$/)
|
|
assert.equal(new URL(artifact.url).protocol, 'https:')
|
|
assert.ok(artifact.url.includes(artifact.checksumSha256.slice(0, 12)))
|
|
assert.equal(artifact.required, true)
|
|
}
|
|
})
|
|
|
|
test('custom images do not resolve to an unrelated built-in artifact', () => {
|
|
assert.equal(bridgeArtifact('custom-bridge:test'), undefined)
|
|
})
|