Skip to content

Commit

Permalink
Enable more tests in Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jul 28, 2024
1 parent 4d8b35b commit 953d6f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions packages/knip/test/cli/cli-preprocessor.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { test } from 'bun:test';
import assert from 'node:assert/strict';
import os from 'node:os';
import { resolve } from '../../src/util/path.js';
import { execFactory } from '../helpers/exec.js';

const skipIf = typeof Bun !== 'undefined' && os.platform() === 'win32' ? test.skip : test;

const cwd = resolve('fixtures/cli-preprocessor');

const exec = execFactory(cwd);
Expand All @@ -30,7 +27,7 @@ test('knip --preprocessor @org/preprocessor', () => {
assert.equal(stdout, 'hi from scoped preprocessor');
});

skipIf(`knip --preprocessor with-args --preprocessor-options {"food":"cupcake"}`, () => {
test(`knip --preprocessor with-args --preprocessor-options {"food":"cupcake"}`, () => {
const { stdout } = exec(`knip --preprocessor with-args --preprocessor-options {\\"food\\":\\"cupcake\\"}`);
assert.equal(stdout, 'hi from with-args preprocessor, you gave me: cupcake');
});
4 changes: 1 addition & 3 deletions packages/knip/test/self-reference-from-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { resolve } from '../src/util/path.js';
import baseArguments from './helpers/baseArguments.js';
import baseCounters from './helpers/baseCounters.js';

const skipIf = typeof Bun !== 'undefined' ? test.skip : test;

const cwd = resolve('fixtures/self-reference-from-plugin');

skipIf('Allows self-references from plugin', async () => {
test('Allows self-references from plugin', async () => {
const { counters } = await main({
...baseArguments,
cwd,
Expand Down

0 comments on commit 953d6f6

Please sign in to comment.