release: bridge legacy installations to ForgeFlow-Public
This commit is contained in:
1 parent
1192d75d15
commit
8769f07539
16 files changed
+339
-222
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import releasePolicy from '../src/shared/release-policy.cjs';
|
||||
|
||||
const { windowsReleaseAssetNames, existingReleaseState } = releasePolicy;
|
||||
const commit = 'a'.repeat(40);
|
||||
const version = '0.10.16';
|
||||
|
||||
test('a draft for another commit cannot receive replacement release assets', () => {
|
||||
assert.throws(() => existingReleaseState({ target_commitish: 'b'.repeat(40), draft: true }, version, commit), /Bump the version/);
|
||||
});
|
||||
|
||||
test('a matching draft can resume while a complete published release is immutable', () => {
|
||||
assert.equal(existingReleaseState({ target_commitish: commit, draft: true }, version, commit), 'draft');
|
||||
assert.equal(existingReleaseState({ target_commitish: commit, draft: false, assets: windowsReleaseAssetNames(version).map((name) => ({ name })) }, version, commit), 'published');
|
||||
});
|
||||
|
||||
test('a published release missing its signature cannot be treated as complete', () => {
|
||||
const assets = windowsReleaseAssetNames(version).filter((name) => !name.endsWith('.sig')).map((name) => ({ name }));
|
||||
assert.throws(() => existingReleaseState({ target_commitish: commit, draft: false, assets }, version, commit), /release-manifest.json.sig/);
|
||||
});
|
||||
Reference in new issue
Block a user