mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-10 06:01:11 +00:00
Fix tests for always-auth
This commit is contained in:
parent
9c950f557c
commit
17f3fe1837
6 changed files with 36 additions and 32 deletions
|
@ -33,13 +33,13 @@ describe('installer tests', () => {
|
|||
});
|
||||
|
||||
it('Sets up npmrc for npmjs', async () => {
|
||||
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||
await auth.configAuthentication('https://registry.npmjs.org/', 'false');
|
||||
expect(fs.existsSync(rcFile)).toBe(true);
|
||||
expect(fs.readFileSync(rcFile, {encoding: 'utf8'})).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('Appends trailing slash to registry', async () => {
|
||||
await auth.configAuthentication('https://registry.npmjs.org');
|
||||
await auth.configAuthentication('https://registry.npmjs.org', 'false');
|
||||
|
||||
expect(fs.existsSync(rcFile)).toBe(true);
|
||||
expect(fs.readFileSync(rcFile, {encoding: 'utf8'})).toMatchSnapshot();
|
||||
|
@ -47,16 +47,22 @@ describe('installer tests', () => {
|
|||
|
||||
it('Configures scoped npm registries', async () => {
|
||||
process.env['INPUT_SCOPE'] = 'myScope';
|
||||
await auth.configAuthentication('https://registry.npmjs.org');
|
||||
await auth.configAuthentication('https://registry.npmjs.org', 'false');
|
||||
|
||||
expect(fs.existsSync(rcFile)).toBe(true);
|
||||
expect(fs.readFileSync(rcFile, {encoding: 'utf8'})).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('Automatically configures GPR scope', async () => {
|
||||
await auth.configAuthentication('npm.pkg.github.com');
|
||||
await auth.configAuthentication('npm.pkg.github.com', 'false');
|
||||
|
||||
expect(fs.existsSync(rcFile)).toBe(true);
|
||||
expect(fs.readFileSync(rcFile, {encoding: 'utf8'})).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('Sets up npmrc for always-auth true', async () => {
|
||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
||||
expect(fs.existsSync(rcFile)).toBe(true);
|
||||
expect(fs.readFileSync(rcFile, {encoding: 'utf8'})).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue