Skip to content

Commit

Permalink
feat: Rename Invalid Files section for IaC
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilianna Papastefanou committed May 11, 2022
1 parent d71373a commit 1d21526
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/formatters/iac-output/v2/failures/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { colors } from '../color-utils';
export function formatIacTestFailures(testFailures: IacFileInDirectory[]) {
const sectionComponents: string[] = [];

const titleOutput = colors.info.bold(`Invalid Files: ${testFailures.length}`);
const titleOutput = colors.info.bold(`Test Failures`);
sectionComponents.push(titleOutput);

const testFailuresListOutput = formatFailuresList(testFailures);
Expand Down
4 changes: 2 additions & 2 deletions test/jest/acceptance/iac/iac-output.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Target file: ${dirPath}/`);
const { stdout } = await run(`snyk iac test ${dirPath}`);

// Assert
expect(stdout).not.toContain('Invalid Files');
expect(stdout).not.toContain('Test Failures');
});

describe.each`
Expand Down Expand Up @@ -241,7 +241,7 @@ https://support.snyk.io/hc/en-us/articles/360013723877-Test-your-Terraform-files
});

describe('with no issues', () => {
it('it should display an appropriate message in the issues section', async () => {
it('should display an appropriate message in the issues section', async () => {
// Arrange
const filePath = 'iac/terraform/vars.tf';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const testFailureFixtures: IacFileInDirectory[] = JSON.parse(
);

describe('formatIacTestFailures', () => {
it('should include the "Invalid Files: X" title with the correct value', () => {
it('should include the "Invalid files: X" title with the correct value', () => {
// Act
const result = formatIacTestFailures(testFailureFixtures);

// Assert
expect(result).toContain(colors.info.bold(`Invalid Files: 5`));
expect(result).toContain(colors.info.bold(`Test Failures`));
});

it('should include the failures list with the correct values', () => {
Expand Down

0 comments on commit 1d21526

Please sign in to comment.