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; 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'); }); });