message: Add initial test around cache
diff: @@ -400,4 +400,36 @@ describe('SingleInstanceGithubCredentialsProvider tests', () => {
  }),
  ).resolves.not.toThrow();
  });
  +
  + it('should cache access token', async () => {
  + octokit.apps.listInstallations.mockResolvedValueOnce({
  + headers: {
  + etag: '123',
  + },
  + data: [
  + {
  + id: 1,
  + repository_selection: 'all',
  + account: {
  + login: 'backstage',
  + },
  + },
  + ],
  + } as RestEndpointMethodTypes['apps']['listInstallations']['response']);
  +
  + octokit.apps.createInstallationAccessToken.mockResolvedValueOnce({
  + data: {
  + expires_at: DateTime.local().plus({ hours: 1 }).toString(),
  + token: 'secret_token',
  + },
  + } as RestEndpointMethodTypes['apps']['createInstallationAccessToken']['response']);
  +
  + for (let i = 0; i < 2; i++) {
  + const { token, headers } = await github.getCredentials({
  + url: 'https://github.com/backstage',
  + });
  + expect(headers).toEqual({ Authorization: 'Bearer secret_token' });
  + expect(token).toEqual('secret_token');
  + }
  + });
  });
  