Skip to content

Commit

Permalink
Fix knip --version command (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
sloanesturz authored Feb 23, 2024
1 parent fabacab commit 1c989c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/knip/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '4.4.0';
export const version = '5.0.1';
6 changes: 5 additions & 1 deletion packages/knip/test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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', () => {
Expand Down

0 comments on commit 1c989c9

Please sign in to comment.