mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-23 03:18:09 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
const assert = require('node:assert/strict');
|
||||
const { test } = require('node:test');
|
||||
const {
|
||||
bootstrapEdgeAdoptedStorage,
|
||||
} = require('@qinglong/local-admin/adopted-profile/edge');
|
||||
const {
|
||||
bootstrapStandaloneAdoptedStorage,
|
||||
} = require('@qinglong/local-admin/adopted-profile/standalone');
|
||||
|
||||
for (const [profile, bootstrap] of [
|
||||
['edge', bootstrapEdgeAdoptedStorage],
|
||||
['standalone', bootstrapStandaloneAdoptedStorage],
|
||||
]) {
|
||||
test(`adopted ${profile} subpath fixes the Profile while remaining default-off`, async () => {
|
||||
const storage = [];
|
||||
const adoption = [];
|
||||
const result = await bootstrap({
|
||||
enabled: false,
|
||||
sourcePath: 'invalid',
|
||||
targetPath: 'invalid',
|
||||
recoveryPath: 'invalid',
|
||||
manifestPath: 'invalid',
|
||||
activationPath: 'invalid',
|
||||
expectedActivationDigest: 'invalid',
|
||||
audit: (record) => storage.push(record),
|
||||
adoptionAudit: (record) => adoption.push(record),
|
||||
});
|
||||
assert.equal(result.status, 'disabled');
|
||||
assert.equal(result.profile, profile);
|
||||
assert.equal(storage[0].profile, profile);
|
||||
assert.equal(adoption[0].profile, profile);
|
||||
await result.stop();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user