From 0fbe92bb605b9efabd533bbba6ff11e2b599f61d Mon Sep 17 00:00:00 2001 From: Sargun Vohra Date: Mon, 9 Jan 2023 11:48:41 -0800 Subject: [PATCH] add basic test Signed-off-by: Sargun Vohra --- test/yarn-auditer.spec.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/yarn-auditer.spec.js b/test/yarn-auditer.spec.js index cd6caa3f..2b8e12f4 100644 --- a/test/yarn-auditer.spec.js +++ b/test/yarn-auditer.spec.js @@ -446,6 +446,30 @@ describe("yarn-auditer", function testYarnAuditer() { ); } ); + (canRunYarnBerry ? it : it.skip)( + "reports summary with vulnerabilities in yarn berry workspaces with extra-args: --environment production", + async () => { + const summary = await audit( + config({ + directory: testDirectory("yarn-berry-workspace"), + levels: { moderate: true }, + "extra-args": ["--environment", "production"], + "report-type": "important", + }), + (_summary) => _summary + ); + expect(summary).to.eql( + summaryWithDefault({ + failedLevelsFound: ["high", "moderate"], + advisoriesFound: ["GHSA-38f5-ghc2-fcmv", "GHSA-rvg8-pwq2-xj7q"], + advisoryPathsFound: [ + "GHSA-38f5-ghc2-fcmv|cryo", + "GHSA-rvg8-pwq2-xj7q|base64url", + ], + }) + ); + } + ); it("does not report duplicate paths", async () => { const summary = await audit( config({