feat(ql3): establish 3.0 incubation baseline

This commit is contained in:
whyour
2026-08-12 00:25:26 +08:00
parent 4bf92dcfeb
commit c699c32461
2817 changed files with 779642 additions and 653 deletions
@@ -0,0 +1,34 @@
const assert = require('node:assert/strict');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const { test } = require('node:test');
const {
bootstrapEdgeStorage,
} = require('@qinglong/local-sqlite/profile/edge');
const {
bootstrapStandaloneStorage,
} = require('@qinglong/local-sqlite/profile/standalone');
for (const [profile, bootstrap] of [
['edge', bootstrapEdgeStorage],
['standalone', bootstrapStandaloneStorage],
]) {
test(`${profile} subpath fixes the Profile and leaves disabled storage untouched`, async () => {
const records = [];
const databasePath = path.join(
os.tmpdir(),
`ql3-${profile}-missing`,
'db.sqlite',
);
const result = await bootstrap({
enabled: false,
databasePath,
audit: (record) => records.push(record),
});
assert.equal(result.profile, profile);
assert.equal(result.status, 'disabled');
assert.equal(fs.existsSync(databasePath), false);
assert.deepEqual(records, [{ profile, state: 'disabled' }]);
});
}