-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
46 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,6 @@ tsconfig.json | |
# exclude cdk artifacts | ||
**/cdk.out | ||
junit.xml | ||
test/ | ||
test/ | ||
jest.config.js | ||
jest.setup.local.js |
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,5 @@ | ||
const baseConfig = require('cdk-build-tools/config/jest.config'); | ||
// no point in collecting coverage for monocdk | ||
baseConfig.collectCoverage = false; | ||
baseConfig.setupFiles = ['./jest.setup.local.js']; | ||
module.exports = baseConfig; |
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,6 @@ | ||
// disallow tests (and production code) in monocdk from including the @aws-cdk/core module, | ||
// which effectively bans using any @aws-cdk/* module, | ||
// as they all depend on @aws-cdk/core | ||
jest.mock('@aws-cdk/core', () => { | ||
throw new Error('@aws-cdk/core is not available in monocdk tests!') | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as cfn_inc from '../../cloudformation-include'; | ||
import * as s3 from '../../aws-s3'; | ||
import { Stack } from '../../lib'; | ||
|
||
test('cloudformation-include works in monocdk', () => { | ||
const stack = new Stack(); | ||
const cfnInclude = new cfn_inc.CfnInclude(stack, 'Template', { | ||
templateFile: `${__dirname}/minimal-template.json` | ||
}); | ||
const cfnBucket = cfnInclude.getResource('Bucket') as s3.CfnBucket; | ||
|
||
expect(cfnBucket.bucketName).toEqual('my-bucket'); | ||
}); |
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,10 @@ | ||
{ | ||
"Resources": { | ||
"Bucket": { | ||
"Type": "AWS::S3::Bucket", | ||
"Properties": { | ||
"BucketName": "my-bucket" | ||
} | ||
} | ||
} | ||
} |