Skip to content

Commit

Permalink
chore: format test
Browse files Browse the repository at this point in the history
  • Loading branch information
karolyp committed Oct 20, 2023
1 parent 98879f8 commit 3c17537
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ const providerArnRegexp =
/^arn:\$\{Token\[.+\]\}:iam::\$\{Token\[.+\]\}:oidc-provider\/token\.actions\.githubusercontent\.com$/i;

test('New Provider', () => {

const app = new cdk.App();
const stack = new cdk.Stack(app);
new GithubActionsIdentityProvider(stack, 'GithubProvider');
const template = Template.fromStack(stack);

template.hasResourceProperties('Custom::AWSCDKOpenIdConnectProvider', {
ClientIDList: ['sts.amazonaws.com'],
ClientIDList: [
'sts.amazonaws.com',
],
Url: 'https://token.actions.githubusercontent.com',
});
});

test('Existing Provider', () => {

const app = new cdk.App();
const stack = new cdk.Stack(app);
const provider = GithubActionsIdentityProvider.fromAccount(
stack,
'GithubProvider',
);
const provider = GithubActionsIdentityProvider.fromAccount(stack, 'GithubProvider');

expect(provider.openIdConnectProviderIssuer).toBe(
'token.actions.githubusercontent.com',
);
expect(provider.openIdConnectProviderIssuer).toBe('token.actions.githubusercontent.com');
expect(provider.openIdConnectProviderArn).toMatch(providerArnRegexp);
});

0 comments on commit 3c17537

Please sign in to comment.