Skip to content

Commit

Permalink
chore: use sort instead of toSorted
Browse files Browse the repository at this point in the history
  • Loading branch information
j-luong committed Dec 3, 2024
1 parent d298e62 commit 9d8826f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/jest/acceptance/snyk-code/snyk-code.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('snyk code test', () => {
expect(code).toBe(EXIT_CODE_FAIL_WITH_ERROR);
});

it('should succeed with correct exit code - with sarif output', async () => {
it.only('should succeed with correct exit code - with sarif output', async () => {
const sarifPayload = require('./fixtures/test-sarif.json');
server.setOrgSetting('sast', true);
deepCodeServer.setCustomResponse({
Expand Down Expand Up @@ -148,10 +148,10 @@ describe('snyk code test', () => {

expect(code).toBe(EXIT_CODE_ACTION_NEEDED);
expect(stderr).toBe('');
const sortedResults = sarifPayload.runs[0].results.toSorted((a, b) => {
const sortedResults = sarifPayload.runs[0].results.sort((a, b) => {
return a.fingerprints.identity.localeCompare(b.fingerprints.identity);
});
const sortedStdOut = JSON.parse(stdout).runs[0].results.toSorted((a, b) => {
const sortedStdOut = JSON.parse(stdout).runs[0].results.sort((a, b) => {
return a.fingerprints.identity.localeCompare(b.fingerprints.identity);
})
expect(sortedStdOut).toEqual(sortedResults)
Expand Down Expand Up @@ -188,10 +188,10 @@ describe('snyk code test', () => {
expect(stderr).toBe('');
expect(code).toBe(EXIT_CODE_ACTION_NEEDED);

const sortedResults = sarifPayload.runs[0].results.toSorted((a, b) => {
const sortedResults = sarifPayload.runs[0].results.sort((a, b) => {
return a.fingerprints.identity.localeCompare(b.fingerprints.identity);
});
const sortedStdOut = JSON.parse(stdout).runs[0].results.toSorted((a, b) => {
const sortedStdOut = JSON.parse(stdout).runs[0].results.sort((a, b) => {
return a.fingerprints.identity.localeCompare(b.fingerprints.identity);
})
expect(sortedStdOut).toEqual(sortedResults)
Expand Down

0 comments on commit 9d8826f

Please sign in to comment.