This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const sdkDirectory = resolve(process.cwd(), 'static/sgs-map-sdk')
|
||||
const readSdkFile = (name: string) => readFileSync(resolve(sdkDirectory, name), 'utf8')
|
||||
const sha256 = (name: string) => createHash('sha256').update(readFileSync(resolve(sdkDirectory, name))).digest('hex').toUpperCase()
|
||||
|
||||
describe('SGS Map SDK 2.5.0 release contract', () => {
|
||||
it('keeps the local package, bridge self-report, and default Engine path aligned', () => {
|
||||
@@ -30,4 +32,22 @@ describe('SGS Map SDK 2.5.0 release contract', () => {
|
||||
expect(existsSync(resolve(sdkDirectory, file))).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
it('pins the complete 2.5.0 artifact set to prevent a partial stale package', () => {
|
||||
expect({
|
||||
global: sha256('index.global.js'),
|
||||
globalMap: sha256('index.global.js.map'),
|
||||
module: sha256('index.mjs'),
|
||||
moduleMap: sha256('index.mjs.map'),
|
||||
types: sha256('index.d.ts'),
|
||||
moduleTypes: sha256('index.d.mts')
|
||||
}).toEqual({
|
||||
global: '3C93DEE217615FD9454A4A8EE4282114471B36DA2B3C7A5F2B2C0FDB18BEF5D1',
|
||||
globalMap: 'EB0C1470AED546194B48386DD092E6D5813CA41E4C3B561838CFC5AE290677CF',
|
||||
module: 'D3C885464B887276BCB420A45BBB5AF2BECA0779482571013789EF61A0E29D59',
|
||||
moduleMap: 'A074A886F5EFE400ACD8F7A5591B7043BA2FF10500B429AFC6490BB7EEAA1430',
|
||||
types: '2E5875CABC6464F2A60625F7400B34B048BD706411FDEA271DBD9D3D4A9BDDD4',
|
||||
moduleTypes: '2E5875CABC6464F2A60625F7400B34B048BD706411FDEA271DBD9D3D4A9BDDD4'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user