From dd19a56732b5d1a5ce58d77f1488d4b9821c1894 Mon Sep 17 00:00:00 2001 From: Zachary Eisinger Date: Tue, 26 Nov 2019 15:08:48 -0800 Subject: [PATCH] Fix test broken by changes to gpr case --- __tests__/__snapshots__/authutil.test.ts.snap | 2 +- __tests__/authutil.test.ts | 38 ++++++++++++++----- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/__tests__/__snapshots__/authutil.test.ts.snap b/__tests__/__snapshots__/authutil.test.ts.snap index 6944c78..d310f14 100644 --- a/__tests__/__snapshots__/authutil.test.ts.snap +++ b/__tests__/__snapshots__/authutil.test.ts.snap @@ -115,7 +115,7 @@ exports[`authutil tests Existing config w/ two GPR sources, sets up a partial Nu " - + diff --git a/__tests__/authutil.test.ts b/__tests__/authutil.test.ts index de0fd7d..0ed596d 100644 --- a/__tests__/authutil.test.ts +++ b/__tests__/authutil.test.ts @@ -44,7 +44,7 @@ const gprNuGetConfig: string = ` const twogprNuGetConfig: string = ` - + `; @@ -94,7 +94,9 @@ describe('authutil tests', () => { it('No existing config, sets up a full NuGet.config with URL and user/PAT for GPR', async () => { process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN'; - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); expect(fs.existsSync(nugetConfigFile)).toBe(true); expect( fs.readFileSync(nugetConfigFile, {encoding: 'utf8'}) @@ -104,7 +106,9 @@ describe('authutil tests', () => { it('No existing config, auth token environment variable not provided, throws', async () => { let thrown = false; try { - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); } catch { thrown = true; } @@ -114,7 +118,9 @@ describe('authutil tests', () => { it('No existing config, sets up a full NuGet.config with URL and other owner/PAT for GPR', async () => { process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN'; process.env['INPUT_OWNER'] = 'otherorg'; - await auth.configAuthentication('https://nuget.pkg.github.com/otherorg/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/otherorg/index.json' + ); expect(fs.existsSync(nugetConfigFile)).toBe(true); expect( fs.readFileSync(nugetConfigFile, {encoding: 'utf8'}) @@ -130,7 +136,9 @@ describe('authutil tests', () => { fs.writeFileSync(inputNuGetConfigPath, invalidNuGetConfig); let thrown = false; try { - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); } catch { thrown = true; } @@ -144,7 +152,9 @@ describe('authutil tests', () => { 'nuget.config' ); fs.writeFileSync(inputNuGetConfigPath, emptyNuGetConfig); - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); expect(fs.existsSync(nugetConfigFile)).toBe(true); expect( fs.readFileSync(nugetConfigFile, {encoding: 'utf8'}) @@ -158,7 +168,9 @@ describe('authutil tests', () => { 'nuget.config' ); fs.writeFileSync(inputNuGetConfigPath, nugetorgNuGetConfig); - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); expect(fs.existsSync(nugetConfigFile)).toBe(true); expect( fs.readFileSync(nugetConfigFile, {encoding: 'utf8'}) @@ -172,7 +184,9 @@ describe('authutil tests', () => { 'nuget.config' ); fs.writeFileSync(inputNuGetConfigPath, gprNuGetConfig); - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); expect(fs.existsSync(nugetConfigFile)).toBe(true); expect( fs.readFileSync(nugetConfigFile, {encoding: 'utf8'}) @@ -186,7 +200,9 @@ describe('authutil tests', () => { 'nuget.config' ); fs.writeFileSync(inputNuGetConfigPath, gprnugetorgNuGetConfig); - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); expect(fs.existsSync(nugetConfigFile)).toBe(true); expect( fs.readFileSync(nugetConfigFile, {encoding: 'utf8'}) @@ -216,7 +232,9 @@ describe('authutil tests', () => { fs.writeFileSync(inputNuGetConfigPath, spaceNuGetConfig); let thrown = false; try { - await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json'); + await auth.configAuthentication( + 'https://nuget.pkg.github.com/OwnerName/index.json' + ); } catch { thrown = true; }