-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from atlassian/ARC-2288-add-metrics-to-requests
ARC-2288 add metrics and update tests
- Loading branch information
Showing
17 changed files
with
375 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,39 @@ | ||
import { disconnectJenkinsServer } from './disconnect-jenkins-server'; | ||
|
||
jest.mock('@forge/api', () => { | ||
return { | ||
__getRuntime: jest.fn(), | ||
storage: { | ||
delete: jest.fn(), | ||
deleteSecret: jest.fn() | ||
} | ||
}; | ||
}); | ||
|
||
jest.mock('@forge/metrics', () => { | ||
const incr = jest.fn(); | ||
const counter = jest.fn(() => ({ incr })); | ||
|
||
return { | ||
__esModule: true, | ||
default: { | ||
internalMetrics: { | ||
counter | ||
} | ||
}, | ||
internalMetrics: { | ||
counter | ||
} | ||
}; | ||
}); | ||
|
||
describe('Delete Jenkins Server Suite', () => { | ||
afterEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('Should delete Jenkins server configuration from Forge Storage', async () => { | ||
const result = await disconnectJenkinsServer('test-uid', 'cloudId', 'accountId'); | ||
const result = await disconnectJenkinsServer('test-uuid', 'cloudId', 'accountId'); | ||
expect(result).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.