Skip to content

Commit

Permalink
Update snapshot tests (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzantow authored Mar 28, 2022
1 parent 78724dc commit 8f01f3e
Show file tree
Hide file tree
Showing 4 changed files with 2,096 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
lib/**/*

# Test data
sbom-action-*/
3 changes: 3 additions & 0 deletions src/github/GithubClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export interface DependencySnapshot {
};
sha: string;
ref: string;
detector: {
version: string;
};
}

/**
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/GitHubSnapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ describe("GitHub Snapshot", () => {

expect(submission.scanned).toBeDefined();

// redact the timestamp
// redact changing data
submission.scanned = "";
submission.detector.version = "";

expect(JSON.stringify(submission)).toMatchSnapshot();
expect(submission).toMatchSnapshot();
});
});
2,087 changes: 2,086 additions & 1 deletion tests/integration/__snapshots__/GitHubSnapshot.test.ts.snap

Large diffs are not rendered by default.

0 comments on commit 8f01f3e

Please sign in to comment.