Skip to content

Commit

Permalink
build: Add unit tests for task-get command
Browse files Browse the repository at this point in the history
...
  • Loading branch information
Göran Sander committed Nov 22, 2023
1 parent be0ca72 commit 42fd155
Show file tree
Hide file tree
Showing 2 changed files with 411 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const defaultTestTimeout = process.env.CTRL_Q_TEST_TIMEOUT || 600000; // 10 minu
console.log(`Jest timeout: ${defaultTestTimeout}`);
jest.setTimeout(defaultTestTimeout);

test('get tasks (verify parameters)', async () => {
test('get tasks (verify parameters) ', async () => {
expect(options.authCertFile).not.toHaveLength(0);
expect(options.authCertKeyFile).not.toHaveLength(0);
expect(options.host).not.toHaveLength(0);
Expand All @@ -34,7 +34,7 @@ test('get tasks (verify parameters)', async () => {
});

// Test suite for task table
describe('get tasks as table', () => {
describe('get tasks as table (cert auth)', () => {
test('get reload + ext pgm tasks as table on screen, columns "common"', async () => {
options.outputFormat = 'table';
options.outputDest = 'screen';
Expand Down Expand Up @@ -63,7 +63,7 @@ describe('get tasks as table', () => {
});

// Test suite for task tree
describe('get tasks as tree', () => {
describe('get tasks as tree (cert auth)', () => {
test('get tasks as tree on screen, no detail columns, colored text', async () => {
options.outputFormat = 'tree';
options.outputDest = 'screen';
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('get tasks as tree', () => {
});

// Test suite for storing table output to file
describe('get tasks as table, store to file', () => {
describe('get tasks as table, store to file (cert auth)', () => {
test('get tasks as table, store to CSV, columns "common", "tag"', async () => {
const outputDir = 'task_export_1';
const outputFile = `task_get_table_1.csv`;
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('get tasks as table, store to file', () => {
fs.rmSync(outputDir, { recursive: true });
});

test('get tasks as table, store to CSV, no detail columns option', async () => {
test('get tasks as table, store to CSV, no detail columns option (cert auth)', async () => {
const outputDir = 'task_export_2';
const outputFile = `task_get_table_2.csv`;

Expand Down Expand Up @@ -284,7 +284,7 @@ describe('get tasks as table, store to file', () => {
});

// Test suite for storing tree output to file
describe('get tasks as tree, store to JSON file', () => {
describe('get tasks as tree, store to JSON file (cert auth)', () => {
test('no detail columns or colored text, use icons', async () => {
const outputDir = 'task_export';
const outputFile = `task_get_table.json`;
Expand Down
Loading

0 comments on commit 42fd155

Please sign in to comment.