Skip to content

Commit

Permalink
chore: Add cmd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
angelmadames committed Mar 1, 2024
1 parent 8fac96d commit 1e78d77
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/utils/cmd.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { describe, expect, test } from 'bun:test';
import cmd from '../../src/utils/cmd';

describe('Utils: cmd', () => {
test('runs commands and returns undefined', () => {
expect(cmd.run("cat /dev/null")).toBeUndefined();
});

test('removes extra spaces from multi-line and returns undefined', () => {
expect(cmd.run("cat /dev/null ")).toBeUndefined();
});

test('returns output to stdout', () => {
const output = cmd.runIt("echo 'Hello world!'");
expect(output.trim()).toEqual('Hello world!');
});
});

0 comments on commit 1e78d77

Please sign in to comment.