Skip to content

Commit

Permalink
test: Add commander share-options tests
Browse files Browse the repository at this point in the history
  • Loading branch information
angelmadames committed Mar 20, 2024
1 parent b3f3c1a commit a027e47
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/utils/shared-options.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { describe, expect, test } from 'bun:test';
import { sharedOptions } from '../../src/utils/shared-options';

describe('Utils: sharedOptions', () => {
test('info() should return an Option object with the correct properties', () => {
const option = sharedOptions.info();
expect(option).toHaveProperty('flags', '-i, --info');
expect(option).toHaveProperty('defaultValue', false);
});

test('gitRef() should return an Option object with the correct properties', () => {
const option = sharedOptions.gitRef();
expect(option).toHaveProperty('flags', '-g, --git-ref [ref]');
expect(option).toHaveProperty('defaultValue', undefined);
});

test('reposRoot() should return an Option object with the correct properties', () => {
const option = sharedOptions.reposRoot();
expect(option).toHaveProperty('flags', '-o, --repos-root [path]');
expect(option).toHaveProperty('defaultValue', undefined);
});

test('gitOrg() should return an Option object with the correct properties', () => {
const option = sharedOptions.gitOrg();
expect(option).toHaveProperty('flags', '-z, --git-org [git-org]');
expect(option).toHaveProperty('defaultValue', undefined);
});

test('repos() should return an Option object with the correct properties', () => {
const option = sharedOptions.repos();
expect(option).toHaveProperty('flags', '-r, --repos [repos]');
expect(option).toHaveProperty('defaultValue', undefined);
});

test('force() should return an Option object with the correct properties', () => {
const option = sharedOptions.force();
expect(option).toHaveProperty('flags', '-f, --force');
expect(option).toHaveProperty('defaultValue', false);
});
});

0 comments on commit a027e47

Please sign in to comment.