From e0eab1f58d85bff33d0090fdf971908908ead677 Mon Sep 17 00:00:00 2001 From: JoannaaKL Date: Thu, 9 Nov 2023 13:27:14 +0000 Subject: [PATCH] . --- packages/core/__tests__/core.test.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/core/__tests__/core.test.ts b/packages/core/__tests__/core.test.ts index 62b7817b..909da71f 100644 --- a/packages/core/__tests__/core.test.ts +++ b/packages/core/__tests__/core.test.ts @@ -169,11 +169,20 @@ describe('@actions/core', () => { }) it('setSecret produces the correct command 2', () => { - core.setSecret('%xxx') - core.setSecret('%25') + core.setSecret('secret val %') + core.setSecret('multi\nline\r\nsecret') assertWriteCalls([ - `::add-mask::%25xxx`, - `::add-mask::%2525` + `::add-mask::secret val %25${os.EOL}`, + `::add-mask::multi%0Aline%0D%0Asecret${os.EOL}` + ]) + }) + + it('setSecret produces the correct command 3', () => { + core.setSecret('secret val %25') + core.setSecret('multi\nline\r\nsecret') + assertWriteCalls([ + `::add-mask::secret val %2525${os.EOL}`, + `::add-mask::multi%0Aline%0D%0Asecret${os.EOL}` ]) })