-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(cli): Use vitest in integration tests
- Loading branch information
Showing
34 changed files
with
75 additions
and
285 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`when key in the set argument is invalid should print the error 1`] = ` | ||
"[31merror[39m - Invalid JSONPath expression "tolerations[[email protected]=='key2'].value": Lexical error on line 1. Unrecognized text. | ||
exports[`when key in the set argument is invalid > should print the error 1`] = ` | ||
"error - Invalid JSONPath expression "tolerations[[email protected]=='key2'].value": Lexical error on line 1. Unrecognized text. | ||
tolerations[[email protected]=='key2'].valu | ||
------------^" | ||
`; | ||
|
||
exports[`when multiple set arguments are provided should output YAML 1`] = ` | ||
exports[`when multiple set arguments are provided > should output YAML 1`] = ` | ||
"--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
|
@@ -52,7 +52,7 @@ spec: | |
- port: 80" | ||
`; | ||
|
||
exports[`when nested value in the set argument is invalid should print the error 1`] = ` | ||
exports[`when nested value in the set argument is invalid > should print the error 1`] = ` | ||
"kosko generate [components..] | ||
Generate Kubernetes manifests | ||
|
@@ -92,7 +92,7 @@ Examples: | |
The specified value "3" is not a string." | ||
`; | ||
|
||
exports[`when output = json should output JSON 1`] = ` | ||
exports[`when output = json > should output JSON 1`] = ` | ||
"{ | ||
"apiVersion": "v1", | ||
"kind": "List", | ||
|
@@ -171,7 +171,7 @@ exports[`when output = json should output JSON 1`] = ` | |
}" | ||
`; | ||
|
||
exports[`when output = yaml should output YAML 1`] = ` | ||
exports[`when output = yaml > should output YAML 1`] = ` | ||
"--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
|
@@ -217,7 +217,7 @@ spec: | |
- port: 80" | ||
`; | ||
|
||
exports[`when output is invalid should print the error 1`] = ` | ||
exports[`when output is invalid > should print the error 1`] = ` | ||
"kosko generate [components..] | ||
Generate Kubernetes manifests | ||
|
@@ -258,7 +258,7 @@ Invalid values: | |
Argument: output, Given: "foo", Choices: "yaml", "json"" | ||
`; | ||
|
||
exports[`when output is not set should output YAML 1`] = ` | ||
exports[`when output is not set > should output YAML 1`] = ` | ||
"--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
|
@@ -304,7 +304,7 @@ spec: | |
- port: 80" | ||
`; | ||
|
||
exports[`when value in the set argument is invalid should print the error 1`] = ` | ||
exports[`when value in the set argument is invalid > should print the error 1`] = ` | ||
"kosko generate [components..] | ||
Generate Kubernetes manifests | ||
|
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
8 changes: 4 additions & 4 deletions
8
packages/cli/integration/generate-loader-error/__tests__/__snapshots__/index.ts.snap
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`should print the error 1`] = ` | ||
"[1mcomponents/nginx.ts[22m - 1 error | ||
"components/nginx.ts - 1 error | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Kind: v1/Pod | ||
Name: test-pod | ||
/spec must have required property 'containers' | ||
[31merror[39m - Generate failed (Total 1 error)" | ||
error - Generate failed (Total 1 error)" | ||
`; |
1 change: 1 addition & 0 deletions
1
packages/cli/integration/generate-loader-error/__tests__/index.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
2 changes: 1 addition & 1 deletion
2
packages/cli/integration/generate-mixed/__tests__/__snapshots__/index.ts.snap
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
2 changes: 1 addition & 1 deletion
2
packages/cli/integration/generate-mjs/__tests__/__snapshots__/index.ts.snap
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: 12 additions & 12 deletions
24
packages/cli/integration/generate-multi-errors/__tests__/__snapshots__/index.ts.snap
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 |
---|---|---|
@@ -1,45 +1,45 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`when bail is not set should print the error 1`] = ` | ||
"[1mcomponents/foo.js[22m - 1 error | ||
exports[`when bail is not set > should print the error 1`] = ` | ||
"components/foo.js - 1 error | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Index: [0] | ||
Kind: v1/Pod | ||
Name: foo | ||
/spec must have required property 'containers' | ||
[1mcomponents/nginx.js[22m - 2 errors | ||
components/nginx.js - 2 errors | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Index: [0] | ||
Kind: apps/v1/Deployment | ||
Name: nginx | ||
/spec must have required property 'selector' | ||
/spec must have required property 'template' | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Index: [1] | ||
Kind: v1/Service | ||
Name: nginx | ||
/spec/ports/0/port must be integer | ||
/spec/type must be equal to one of the allowed values: ["ClusterIP","ExternalName","LoadBalancer","NodePort"] | ||
[31merror[39m - Generate failed (Total 3 errors)" | ||
error - Generate failed (Total 3 errors)" | ||
`; | ||
|
||
exports[`when bail is true should print the error 1`] = ` | ||
"[1mcomponents/foo.js[22m - 1 error | ||
exports[`when bail is true > should print the error 1`] = ` | ||
"components/foo.js - 1 error | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Index: [0] | ||
Kind: v1/Pod | ||
Name: foo | ||
/spec must have required property 'containers' | ||
[31merror[39m - Generate failed (Only the first error is displayed because \`bail\` option is enabled)" | ||
error - Generate failed (Only the first error is displayed because \`bail\` option is enabled)" | ||
`; |
1 change: 1 addition & 0 deletions
1
packages/cli/integration/generate-multi-errors/__tests__/index.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
2 changes: 1 addition & 1 deletion
2
packages/cli/integration/generate-package-type/__tests__/__snapshots__/index.ts.snap
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
1 change: 1 addition & 0 deletions
1
packages/cli/integration/generate-package-type/__tests__/index.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
2 changes: 1 addition & 1 deletion
2
packages/cli/integration/generate-ts-cjs/__tests__/__snapshots__/index.ts.snap
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
2 changes: 1 addition & 1 deletion
2
packages/cli/integration/generate-ts-mjs/__tests__/__snapshots__/index.ts.snap
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
20 changes: 10 additions & 10 deletions
20
packages/cli/integration/generate-validate/__tests__/__snapshots__/index.ts.snap
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`when validate is false should print the manifest 1`] = ` | ||
exports[`when validate is false > should print the manifest 1`] = ` | ||
"apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: foo | ||
spec: {}" | ||
`; | ||
|
||
exports[`when validate is not set should print the error 1`] = ` | ||
"[1mcomponents/foo.js[22m - 1 error | ||
exports[`when validate is not set > should print the error 1`] = ` | ||
"components/foo.js - 1 error | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Kind: v1/Pod | ||
Name: foo | ||
/spec must have required property 'containers' | ||
[31merror[39m - Generate failed (Total 1 error)" | ||
error - Generate failed (Total 1 error)" | ||
`; | ||
|
||
exports[`when validate is true should print the error 1`] = ` | ||
"[1mcomponents/foo.js[22m - 1 error | ||
exports[`when validate is true > should print the error 1`] = ` | ||
"components/foo.js - 1 error | ||
[31m✖ ResolveError: Validation error[39m | ||
✖ ResolveError: Validation error | ||
Kind: v1/Pod | ||
Name: foo | ||
/spec must have required property 'containers' | ||
[31merror[39m - Generate failed (Total 1 error)" | ||
error - Generate failed (Total 1 error)" | ||
`; |
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 was deleted.
Oops, something went wrong.
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
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.