Skip to content

Commit 4ec731e

Browse files
authored
Add key-pair TypeScript unit tests (#97)
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent f86cc1b commit 4ec731e

File tree

10 files changed

+4104
-6
lines changed

10 files changed

+4104
-6
lines changed

package-lock.json

Lines changed: 190 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"affinitygroup_unit_test": "file:tests/ts/iaas/affinityGroups",
13-
"image_unit_test": "file:tests/ts/iaas/image"
13+
"image_unit_test": "file:tests/ts/iaas/image",
14+
"key_pair_unit_test": "file:tests/ts/iaas/key-pair"
1415
}
1516
}

tests/ts/iaas/affinityGroups/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/ts/iaas/image/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/ts/iaas/key-pair/Pulumi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: key_pair_unit_test
2+
description: A minimal TypeScript Pulumi program
3+
runtime:
4+
name: nodejs
5+
options:
6+
packagemanager: npm
7+
config:
8+
pulumi:tags:
9+
value:
10+
pulumi:template: typescript

tests/ts/iaas/key-pair/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as pulumi from "@pulumi/pulumi";
2+
import * as stackit from "@stackitcloud/pulumi-stackit";
3+
4+
export const keyPairPublicKey = "public-key";
5+
export const keyPairName = "example-keyPair-name";
6+
export const keyPairLabelKey = "unit-test";
7+
export const keyPairLabelValue = "test-label-value";
8+
9+
// only optional field is labels
10+
export const exampleKeyPair = new stackit.KeyPair("example_keyPair", {
11+
name: keyPairName,
12+
publicKey: keyPairPublicKey,
13+
labels: {[keyPairLabelKey]:keyPairLabelValue},
14+
});
15+
16+
export const keyPairDatasource = stackit.getKeyPairOutput({
17+
name: keyPairName,
18+
});

0 commit comments

Comments
 (0)