32 lines
1.3 KiB
JavaScript
32 lines
1.3 KiB
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { readFile } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
import { validateAssetBuildManifest } from '../scripts/asset-build-manifest.mjs'
|
|
|
|
const testDirectory = path.dirname(fileURLToPath(import.meta.url))
|
|
const pipelineDirectory = path.resolve(testDirectory, '..')
|
|
const workspace = path.resolve(pipelineDirectory, '..')
|
|
const manifestPath = path.join(pipelineDirectory, 'manifests', 'shared-scroll-skins-v3.json')
|
|
|
|
test('共享卷轴清单只维护四张正式生成资产', async () => {
|
|
const manifest = JSON.parse(await readFile(manifestPath, 'utf8'))
|
|
validateAssetBuildManifest(manifest, workspace)
|
|
|
|
assert.equal(manifest.kind, 'asset-build-manifest')
|
|
assert.equal(manifest.family, 'shared-scroll-skins-v3')
|
|
assert.deepEqual(
|
|
manifest.assets.map(({ id }) => id),
|
|
['shared-scroll-primary-v3', 'shared-scroll-secondary-v3', 'shared-scroll-toast-v3', 'shared-scroll-dialog-v3'],
|
|
)
|
|
for (const asset of manifest.assets) {
|
|
assert.deepEqual(
|
|
Object.keys(asset).sort(),
|
|
['alpha', 'edge', 'id', 'output', 'outputPixels', 'processing', 'quality', 'source', 'sourcePixels'],
|
|
)
|
|
assert.equal(asset.processing.mode, 'chroma-stretch')
|
|
}
|
|
})
|