Created
February 23, 2023 12:11
-
-
Save mrgrain/70e4205477968b31b3f1b767ab088617 to your computer and use it in GitHub Desktop.
projen IntegRunner
This file contains hidden or 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
import { Component, DependencyType, typescript } from 'projen'; | |
/** | |
* This component adds support for using `integ-runner` and `integ-tests` | |
* in a construct library. | |
*/ | |
export class IntegRunner extends Component { | |
constructor(project: typescript.TypeScriptProject, cdkVersion: string) { | |
super(project); | |
project.deps.addDependency(`@aws-cdk/integ-runner@^${cdkVersion}`, DependencyType.DEVENV); | |
project.deps.addDependency(`@aws-cdk/integ-tests-alpha@^${cdkVersion}-alpha.0`, DependencyType.DEVENV); | |
const integSnapshotTask = project.addTask('integ', { | |
description: 'Run integration snapshot tests', | |
receiveArgs: true, | |
exec: 'integ-runner --language typescript', | |
}); | |
project.addTask('integ:update', { | |
description: 'Run and update integration snapshot tests', | |
exec: 'integ-runner --language typescript --update-on-failed', | |
receiveArgs: true, | |
}); | |
project.testTask.spawn(integSnapshotTask); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment