forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate all existing unit tests from nodeunit to jest. As part of this, centralize jest configuration in the `cdk-build-tools` package with the ability for individual packages to override these via the `package.json`. Dropping the `JestCoverageTarget` pkglint rule since this change ensures that a standard set of rules, that include coverage target, will be applied to any package that is configured to use `jest`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* <!-- Please read the contribution guidelines and follow the pull-request checklist: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md -->
- Loading branch information
Showing
13 changed files
with
137 additions
and
219 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,6 @@ cdk.out/ | |
|
||
# Yarn error log | ||
yarn-error.log | ||
|
||
# Generated jest config | ||
jest.config.gen.json |
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
24 changes: 0 additions & 24 deletions
24
packages/@aws-cdk/aws-cognito/test/test.user-pool-client.ts
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
packages/@aws-cdk/aws-cognito/test/user-pool-client.test.ts
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import '@aws-cdk/assert/jest'; | ||
import { Stack } from '@aws-cdk/core'; | ||
import { UserPool, UserPoolClient } from '../lib'; | ||
|
||
describe('User Pool Client', () => { | ||
test('default setup', () => { | ||
// GIVEN | ||
const stack = new Stack(); | ||
const pool = new UserPool(stack, 'Pool', { }); | ||
|
||
// WHEN | ||
new UserPoolClient(stack, 'Client', { | ||
userPool: pool | ||
}); | ||
|
||
// THEN | ||
expect(stack).toHaveResourceLike('AWS::Cognito::UserPoolClient', { | ||
UserPoolId: stack.resolve(pool.userPoolId) | ||
}); | ||
}); | ||
}); |
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.