From 44059c3e2047991d69bfe58e807fd04df198b7f4 Mon Sep 17 00:00:00 2001
From: Yun Lai <ylai@squareup.com>
Date: Fri, 5 Aug 2022 22:06:59 +1000
Subject: [PATCH] fix: join env var lines with os.EOL to fix test failure on
 different systems (#16993)

* fix: join env var lines with os.EOL to fix test failure on different systems

* fix: update test data to achieve full test coverage

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
---
 lib/util/exec/hermit.spec.ts | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/util/exec/hermit.spec.ts b/lib/util/exec/hermit.spec.ts
index 62761c2bc5..3fcc2b3d88 100644
--- a/lib/util/exec/hermit.spec.ts
+++ b/lib/util/exec/hermit.spec.ts
@@ -1,3 +1,4 @@
+import os from 'os';
 import _findUp from 'find-up';
 import upath from 'upath';
 import { mockExecAll } from '../../../test/exec-util';
@@ -54,9 +55,11 @@ describe('util/exec/hermit', () => {
     it('should return hermit environment variables when hermit env returns successfully', async () => {
       findUp.mockResolvedValueOnce(upath.join(localDir, 'bin/hermit'));
       mockExecAll({
-        stdout: `GOBIN=/usr/src/app/repository-a/.hermit/go/bin
-PATH=/usr/src/app/repository-a/bin
-`,
+        stdout:
+          [
+            'GOBIN=/usr/src/app/repository-a/.hermit/go/bin',
+            'PATH=/usr/src/app/repository-a/bin',
+          ].join(os.EOL) + os.EOL,
         stderr: '',
       });
 
-- 
GitLab