Skip to content

Commit

Permalink
test: Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ofekatr committed Apr 5, 2022
1 parent 5638320 commit 2bac1a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions test/acceptance/fake-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const featureFlagDefaults = (): Map<string, boolean> => {
return new Map([
['cliFailFast', false],
['iacTerraformVarSupport', false],
['iacCliOutput', false],
]);
};

Expand Down
23 changes: 15 additions & 8 deletions test/jest/unit/lib/formatters/iac-output/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ describe('IaC Output Formatter', () => {
.spyOn(iacOutputV2, 'getIacDisplayedOutput')
.mockImplementationOnce(jest.fn());

const testIacTestResponse = {} as IacTestResponse;
const testTestedInfoTest = 'test-tested-info-text';
const testMeta = 'test-meta';
const testPrefix = 'test-prefix';
const testIsNewIacOutputSupported = true;

const args: Parameters<typeof getIacDisplayedOutput> = [
{} as IacTestResponse,
'test-tested-info-text',
'test-meta',
'test-prefix',
true,
testIacTestResponse,
testTestedInfoTest,
testMeta,
testPrefix,
testIsNewIacOutputSupported,
];

// Act
Expand All @@ -68,9 +74,10 @@ describe('IaC Output Formatter', () => {
expect(result).toBeUndefined();
expect(getIacDisplayedOutputV1Spy).not.toHaveBeenCalled();
expect(getIacDisplayedOutputV2Spy).toHaveBeenCalledTimes(1);
expect([...getIacDisplayedOutputV2Spy.mock.calls[0]]).toStrictEqual(
args.slice(0, args.length - 1),
);
expect([...getIacDisplayedOutputV2Spy.mock.calls[0]]).toStrictEqual([
testIacTestResponse,
testPrefix,
]);
});
});
});
Expand Down

0 comments on commit 2bac1a7

Please sign in to comment.