feat: publish HoloLake model-native living system source
This commit is contained in:
parent
6ad10edde1
commit
c395dd3a99
2467 changed files with 615073 additions and 0 deletions
|
|
@ -0,0 +1,41 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import { mkdtemp, writeFile } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import test from 'node:test'
|
||||
|
||||
import { resolveInternalReleaseVersion } from './internal-release-version.mjs'
|
||||
|
||||
test('reads the version from tauri.conf.json', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'hololake-release-version-'))
|
||||
await writeFile(join(root, 'tauri.conf.json'), JSON.stringify({ version: '1.2.3' }))
|
||||
|
||||
assert.equal(await resolveInternalReleaseVersion(join(root, 'tauri.conf.json')), '1.2.3')
|
||||
})
|
||||
|
||||
test('accepts an explicit matching version', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'hololake-release-version-'))
|
||||
await writeFile(join(root, 'tauri.conf.json'), JSON.stringify({ version: '1.2.3' }))
|
||||
|
||||
assert.equal(await resolveInternalReleaseVersion(join(root, 'tauri.conf.json'), '1.2.3'), '1.2.3')
|
||||
})
|
||||
|
||||
test('rejects a version that differs from the application configuration', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'hololake-release-version-'))
|
||||
await writeFile(join(root, 'tauri.conf.json'), JSON.stringify({ version: '1.2.3' }))
|
||||
|
||||
await assert.rejects(
|
||||
resolveInternalReleaseVersion(join(root, 'tauri.conf.json'), '1.2.4'),
|
||||
/does not match configured version 1\.2\.3/,
|
||||
)
|
||||
})
|
||||
|
||||
test('rejects malformed configured versions', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'hololake-release-version-'))
|
||||
await writeFile(join(root, 'tauri.conf.json'), JSON.stringify({ version: 'tomorrow' }))
|
||||
|
||||
await assert.rejects(
|
||||
resolveInternalReleaseVersion(join(root, 'tauri.conf.json')),
|
||||
/valid semantic version/,
|
||||
)
|
||||
})
|
||||
Loading…
Reference in a new issue