From 78ab7b952e4082c1b3c2dbaa705bcc43ddae350b Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Fri, 4 Nov 2022 13:07:15 +0100 Subject: [PATCH] Sort issues by package name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 'mit-licensed-depends-on-not-licensed@1.0.1', --- expected +++ actual @@ -1,15 +1,15 @@ -mit-licensed-depends-on-not-licensed@1.0.1 +not-licensed@1.0.0 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 (https://kemitchell.com/) Contributors: None listed -not-licensed@1.0.0 +mit-licensed-depends-on-not-licensed@1.0.1 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 (https://kemitchell.com/) Contributors: None listed test: tests/unlicensed-subdependency/test.js stack: | Object. (tests/unlicensed-subdependency/test.js:7:5) Module.replacementCompile (node_modules/append-transform/index.js:60:13) Object. (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 ``` --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 0a0a917..eb12f13 100644 --- a/index.js +++ b/index.js @@ -101,6 +101,11 @@ function findIssues (configuration, dependencies) { results.push(result) } }) + + results.sort(function (a, b) { + return a.name.localeCompare(b.name) + }) + return results }