From 1c989c9b722e41cec5ecd66faf7a515c593190c5 Mon Sep 17 00:00:00 2001 From: Sloane Sturzenegger Date: Fri, 23 Feb 2024 00:29:12 -0800 Subject: [PATCH] Fix knip --version command (#519) --- packages/knip/src/version.ts | 2 +- packages/knip/test/cli.test.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/knip/src/version.ts b/packages/knip/src/version.ts index ef8cba16a..3a83d5042 100644 --- a/packages/knip/src/version.ts +++ b/packages/knip/src/version.ts @@ -1 +1 @@ -export const version = '4.4.0'; +export const version = '5.0.1'; diff --git a/packages/knip/test/cli.test.ts b/packages/knip/test/cli.test.ts index f13d86a98..1542c858d 100644 --- a/packages/knip/test/cli.test.ts +++ b/packages/knip/test/cli.test.ts @@ -1,6 +1,7 @@ import assert from 'node:assert/strict'; import test from 'node:test'; import { helpText } from '../src/util/cli-arguments.js'; +import { loadJSON } from '../src/util/fs.js'; import { resolve } from '../src/util/path.js'; import { version } from '../src/version.js'; import { execFactory } from './helpers/exec.js'; @@ -9,8 +10,11 @@ const cwd = resolve('fixtures/cli'); const exec = execFactory(cwd); -test('knip --version', () => { +test('knip --version', async () => { assert.equal(exec('knip --version').stdout, version); + + const contents = await loadJSON(resolve('package.json')); + assert.equal(version, contents.version); }); test('knip --help', () => {