GitNexus/gitnexus/test/unit/package-version.test.ts
Gergő Magyar c0c3fa18a9
chore: release v1.6.11 (#3177)
* chore: release v1.6.11

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(test): read /api/info version from package.json

server-info unit tests hardcoded 1.6.10 while buildServerInfo reads
package.json, so the 1.6.11 bump failed ubuntu coverage 3/3.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor: read the published version from one helper

Release bumps kept breaking tests that each re-required package.json.
packageVersion() is now the single read for CLI, MCP, serve, and those tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 20:02:37 +01:00

13 lines
496 B
TypeScript

import { createRequire } from 'node:module';
import { describe, expect, it } from 'vitest';
import { packageVersion } from '../../src/core/package-version.js';
const fromManifest = (createRequire(import.meta.url)('../../package.json') as { version: string })
.version;
describe('packageVersion', () => {
it('returns the same string as gitnexus/package.json#version', () => {
expect(packageVersion()).toBe(fromManifest);
expect(packageVersion()).toMatch(/^\d+\.\d+\.\d+/);
});
});