mirror of
https://github.com/actions/setup-java.git
synced 2024-11-23 18:19:03 +00:00
improve tests
This commit is contained in:
parent
1bba665156
commit
0e5545ead5
@ -92,7 +92,7 @@ describe('auth tests', () => {
|
|||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
||||||
auth.generate('FOO')
|
auth.generate('FOO', auth.DEFAULT_USERNAME, auth.DEFAULT_PASSWORD)
|
||||||
);
|
);
|
||||||
|
|
||||||
await auth.configAuthentication(undefined, 'BAR', undefined);
|
await auth.configAuthentication(undefined, 'BAR', undefined);
|
||||||
@ -100,7 +100,7 @@ describe('auth tests', () => {
|
|||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
||||||
auth.generate(undefined, 'BAR', undefined)
|
auth.generate(auth.DEFAULT_ID, 'BAR', auth.DEFAULT_PASSWORD)
|
||||||
);
|
);
|
||||||
|
|
||||||
await auth.configAuthentication(undefined, undefined, 'BAZ');
|
await auth.configAuthentication(undefined, undefined, 'BAZ');
|
||||||
@ -108,7 +108,7 @@ describe('auth tests', () => {
|
|||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
||||||
auth.generate(undefined, undefined, 'BAZ')
|
auth.generate(auth.DEFAULT_ID, auth.DEFAULT_USERNAME, 'BAZ')
|
||||||
);
|
);
|
||||||
|
|
||||||
await auth.configAuthentication();
|
await auth.configAuthentication();
|
||||||
@ -116,7 +116,11 @@ describe('auth tests', () => {
|
|||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
||||||
auth.generate(undefined, undefined, undefined)
|
auth.generate(
|
||||||
|
auth.DEFAULT_ID,
|
||||||
|
auth.DEFAULT_USERNAME,
|
||||||
|
auth.DEFAULT_PASSWORD
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user