Skip to content

Commit 0bcb38c

Browse files
committed
fix: add guard around uninstall github
1 parent ff4a7ba commit 0bcb38c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

test/github-cli/github-cli.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import { SpawnStatus } from '@codifycli/plugin-core';
2-
import { PluginTester, testSpawn } from '@codifycli/plugin-test';
1+
import {PluginTester, testSpawn} from '@codifycli/plugin-test';
32
import * as path from 'node:path';
4-
import { beforeAll, describe, expect, it } from 'vitest';
3+
import {beforeAll, describe, expect, it} from 'vitest';
4+
import {SpawnStatus} from "@codifycli/schemas";
55

66
describe('GitHub CLI integration tests', async () => {
77
const pluginPath = path.resolve('./src/index.ts');
88

99
beforeAll(async () => {
10-
await PluginTester.uninstall(pluginPath, [{ type: 'github-cli' }]);
10+
const result = await testSpawn('which gh');
11+
12+
if (result.status === SpawnStatus.SUCCESS) {
13+
await PluginTester.uninstall(pluginPath, [{type: 'github-cli'}]);
14+
}
1115
}, 60_000);
1216

1317
it('Can install and uninstall GitHub CLI', { timeout: 300_000 }, async () => {

0 commit comments

Comments
 (0)