Skip to content

Commit 09cc69f

Browse files
author
Zachary Eisinger
committed
Fix tests that do not specify full url
1 parent 167e5cb commit 09cc69f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

__tests__/authutil.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ const nugetorgNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
2929
const gprnugetorgNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
3030
<configuration>
3131
<packageSources>
32-
<add key="GPR" value="https://nuget.pkg.github.com/github/index.json" protocolVersion="3" />
32+
<add key="GPR" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
3333
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
3434
</packageSources>
3535
</configuration>`;
3636

3737
const gprNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
3838
<configuration>
3939
<packageSources>
40-
<add key="GPR" value="https://nuget.pkg.github.com/github/index.json" protocolVersion="3" />
40+
<add key="GPR" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
4141
</packageSources>
4242
</configuration>`;
4343

@@ -52,7 +52,7 @@ const twogprNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
5252
const spaceNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
5353
<configuration>
5454
<packageSources>
55-
<add key="GPR GitHub" value="https://nuget.pkg.github.com/github/index.json" protocolVersion="3" />
55+
<add key="GPR GitHub" value="https://nuget.pkg.github.com/OwnerName/index.json" protocolVersion="3" />
5656
</packageSources>
5757
</configuration>`;
5858

@@ -94,7 +94,7 @@ describe('authutil tests', () => {
9494

9595
it('No existing config, sets up a full NuGet.config with URL and user/PAT for GPR', async () => {
9696
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
97-
await auth.configAuthentication('https://nuget.pkg.github.com');
97+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
9898
expect(fs.existsSync(nugetConfigFile)).toBe(true);
9999
expect(
100100
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
@@ -104,7 +104,7 @@ describe('authutil tests', () => {
104104
it('No existing config, auth token environment variable not provided, throws', async () => {
105105
let thrown = false;
106106
try {
107-
await auth.configAuthentication('https://nuget.pkg.github.com');
107+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
108108
} catch {
109109
thrown = true;
110110
}
@@ -114,7 +114,7 @@ describe('authutil tests', () => {
114114
it('No existing config, sets up a full NuGet.config with URL and other owner/PAT for GPR', async () => {
115115
process.env['NUGET_AUTH_TOKEN'] = 'TEST_FAKE_AUTH_TOKEN';
116116
process.env['INPUT_OWNER'] = 'otherorg';
117-
await auth.configAuthentication('https://nuget.pkg.github.com');
117+
await auth.configAuthentication('https://nuget.pkg.github.com/otherorg/index.json');
118118
expect(fs.existsSync(nugetConfigFile)).toBe(true);
119119
expect(
120120
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
@@ -130,7 +130,7 @@ describe('authutil tests', () => {
130130
fs.writeFileSync(inputNuGetConfigPath, invalidNuGetConfig);
131131
let thrown = false;
132132
try {
133-
await auth.configAuthentication('https://nuget.pkg.github.com');
133+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
134134
} catch {
135135
thrown = true;
136136
}
@@ -144,7 +144,7 @@ describe('authutil tests', () => {
144144
'nuget.config'
145145
);
146146
fs.writeFileSync(inputNuGetConfigPath, emptyNuGetConfig);
147-
await auth.configAuthentication('https://nuget.pkg.github.com');
147+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
148148
expect(fs.existsSync(nugetConfigFile)).toBe(true);
149149
expect(
150150
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
@@ -158,7 +158,7 @@ describe('authutil tests', () => {
158158
'nuget.config'
159159
);
160160
fs.writeFileSync(inputNuGetConfigPath, nugetorgNuGetConfig);
161-
await auth.configAuthentication('https://nuget.pkg.github.com');
161+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
162162
expect(fs.existsSync(nugetConfigFile)).toBe(true);
163163
expect(
164164
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
@@ -172,7 +172,7 @@ describe('authutil tests', () => {
172172
'nuget.config'
173173
);
174174
fs.writeFileSync(inputNuGetConfigPath, gprNuGetConfig);
175-
await auth.configAuthentication('https://nuget.pkg.github.com');
175+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
176176
expect(fs.existsSync(nugetConfigFile)).toBe(true);
177177
expect(
178178
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
@@ -186,7 +186,7 @@ describe('authutil tests', () => {
186186
'nuget.config'
187187
);
188188
fs.writeFileSync(inputNuGetConfigPath, gprnugetorgNuGetConfig);
189-
await auth.configAuthentication('https://nuget.pkg.github.com');
189+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
190190
expect(fs.existsSync(nugetConfigFile)).toBe(true);
191191
expect(
192192
fs.readFileSync(nugetConfigFile, {encoding: 'utf8'})
@@ -216,7 +216,7 @@ describe('authutil tests', () => {
216216
fs.writeFileSync(inputNuGetConfigPath, spaceNuGetConfig);
217217
let thrown = false;
218218
try {
219-
await auth.configAuthentication('https://nuget.pkg.github.com');
219+
await auth.configAuthentication('https://nuget.pkg.github.com/OwnerName/index.json');
220220
} catch {
221221
thrown = true;
222222
}
@@ -236,7 +236,7 @@ describe('authutil tests', () => {
236236
fs.mkdirSync(inputNuGetConfigDirectory, {recursive: true});
237237
fs.writeFileSync(inputNuGetConfigPath, gprNuGetConfig);
238238
await auth.configAuthentication(
239-
'https://nuget.pkg.github.com',
239+
'https://nuget.pkg.github.com/OwnerName/index.json',
240240
'subfolder/nuget.config'
241241
);
242242
expect(fs.existsSync(nugetConfigFile)).toBe(true);

__tests__/installer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ describe('installer tests', () => {
2929
}, 100000);
3030

3131
it('Acquires version of dotnet if no matching version is installed', async () => {
32-
await getDotnet('2.2.104');
33-
const dotnetDir = path.join(toolDir, 'dncs', '2.2.104', os.arch());
32+
await getDotnet('2.2.205');
33+
const dotnetDir = path.join(toolDir, 'dncs', '2.2.205', os.arch());
3434

3535
expect(fs.existsSync(`${dotnetDir}.complete`)).toBe(true);
3636
if (IS_WINDOWS) {

0 commit comments

Comments
 (0)