@@ -45,6 +45,14 @@ async function runHelmDeno(args: string[]) {
4545 return await run ( [ helmDenoBin , ...args ] )
4646}
4747
48+ async function assertYamlParsable ( yamlFileContent : string ) {
49+ try {
50+ await yaml . parseAll ( yamlFileContent )
51+ } catch ( err ) {
52+ throw new Error ( `Cloud parse yaml context ${ err } ${ yamlFileContent } ` )
53+ }
54+ }
55+
4856Deno . test ( {
4957 name : "should successfuly run `helm deno template` with deno chart" ,
5058 async fn ( ) {
@@ -65,6 +73,9 @@ Deno.test({
6573 kind : "Service" ,
6674 metadata : {
6775 name : "my-release-name" ,
76+ annotations : {
77+ "default-annotation" : "default-value" ,
78+ } ,
6879 } ,
6980 spec : {
7081 ports : [
@@ -117,7 +128,6 @@ Deno.test(
117128 stdout . replaceAll ( helmPluginDir , "" ) ,
118129 `\
119130==> Linting /e2e-tests/charts/one-service
120- [INFO] values.yaml: file does not exist
121131[WARNING] templates/: directory not found
122132
1231331 chart(s) linted, 0 chart(s) failed
@@ -220,6 +230,9 @@ Deno.test({
220230 kind : "Service" ,
221231 metadata : {
222232 name : "my-release-name" ,
233+ annotations : {
234+ "default-annotation" : "default-value" ,
235+ } ,
223236 } ,
224237 spec : {
225238 ports : [
@@ -584,6 +597,9 @@ Deno.test({
584597 kind : "Service" ,
585598 metadata : {
586599 name : "my-release-name" ,
600+ annotations : {
601+ "default-annotation" : "default-value" ,
602+ } ,
587603 } ,
588604 spec : {
589605 ports : [
@@ -650,7 +666,7 @@ Deno.test({
650666 "should successfuly run `helm deno template` with remote deno chart (with --repo option)" ,
651667 ignore : ! runAllTests ,
652668 async fn ( ) {
653- const { status } = await runHelmDeno ( [
669+ const { status, stdout , stderr } = await runHelmDeno ( [
654670 "template" ,
655671 "ingress" ,
656672 "nginx-ingress" ,
@@ -660,7 +676,8 @@ Deno.test({
660676 "1.41.3" ,
661677 ] )
662678
663- assertEquals ( status . success , true )
679+ await assertYamlParsable ( stdout )
680+ assertEquals ( status . success , true , stderr )
664681 } ,
665682} )
666683
@@ -702,7 +719,8 @@ Deno.test({
702719 "1.41.3" ,
703720 ] )
704721
705- assertEquals ( templateCmd . status . success , true )
722+ await assertYamlParsable ( templateCmd . stdout )
723+ assertEquals ( templateCmd . status . success , true , templateCmd . stderr )
706724 } finally {
707725 await tmpRepo . cleanup ( )
708726 }
0 commit comments