build: fetch identitydb as remote dependency
This commit is contained in:
31
tests/release-config.test.ts
Normal file
31
tests/release-config.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('release config', () => {
|
||||
it('depends on a remote IdentityDB package source instead of a local file path', () => {
|
||||
const packageJson = JSON.parse(
|
||||
readFileSync(join(process.cwd(), 'package.json'), 'utf8'),
|
||||
) as {
|
||||
dependencies?: Record<string, string>;
|
||||
trustedDependencies?: string[];
|
||||
};
|
||||
|
||||
expect(packageJson.dependencies?.identitydb).toMatch(
|
||||
/^git\+https:\/\/git\.psw\.kr\/p-sw\/IdentityDB\.git#[0-9a-f]{40}$/,
|
||||
);
|
||||
expect(packageJson.trustedDependencies).toEqual(
|
||||
expect.arrayContaining(['better-sqlite3', 'esbuild', 'identitydb']),
|
||||
);
|
||||
});
|
||||
|
||||
it('publishes without cloning a sibling IdentityDB repository first', () => {
|
||||
const workflow = readFileSync(
|
||||
join(process.cwd(), '.gitea/workflows/npm-release.yml'),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
expect(workflow).not.toContain('Clone IdentityDB dependency');
|
||||
expect(workflow).not.toContain('IDENTITYDB_URL');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user