Skip to content

Commit

Permalink
Sort issues by package name
Browse files Browse the repository at this point in the history
Fixes a flaky test:

```
​ FAIL ​ tests/unlicensed-subdependency/test.js
 ✖ should be equal

  tests/unlicensed-subdependency/test.js
   5 | tap.equal(results.status, 1)
   6 |
>  7 | tap.equal(
     | ----^
   8 |   results.stdout.trim(),
   9 |   [
  10 |     '[email protected]',

  --- expected
  +++ actual
  @@ -1,15 +1,15 @@
  [email protected]
  [email protected]
     NOT APPROVED
  -  Terms: MIT
  -  Repository: jslicense/mit-licensed-depends-on-not-licensed.js
  +  Terms: Invalid license metadata
  +  Repository: jslicense/not-licensed.js
     Homepage: None listed
     Author: Kyle E. Mitchell <[email protected]> (https://kemitchell.com/)
     Contributors: None listed

  [email protected]
  [email protected]
     NOT APPROVED
  -  Terms: Invalid license metadata
  -  Repository: jslicense/not-licensed.js
  +  Terms: MIT
  +  Repository: jslicense/mit-licensed-depends-on-not-licensed.js
     Homepage: None listed
     Author: Kyle E. Mitchell <[email protected]> (https://kemitchell.com/)
     Contributors: None listed

  test: tests/unlicensed-subdependency/test.js
  stack: |
    Object.<anonymous> (tests/unlicensed-subdependency/test.js:7:5)
    Module.replacementCompile (node_modules/append-transform/index.js:60:13)
    Object.<anonymous> (node_modules/append-transform/index.js:64:4)

​ FAIL ​ tests/unlicensed-subdependency/test.js 1 failed of 2 16.992ms
 ✖ should be equal

  🌈 SUMMARY RESULTS 🌈

​ FAIL ​ tests/unlicensed-subdependency/test.js 1 failed of 2 16.992ms
 ✖ should be equal
```
  • Loading branch information
CvX committed Nov 4, 2022
1 parent 9abd28f commit 9c3fc94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ function findIssues (configuration, dependencies) {
results.push(result)
}
})

results.sort(function (a, b) {
return a.name.localeCompare(b.name)
})

return results
}

Expand Down

0 comments on commit 9c3fc94

Please sign in to comment.