@@ -18,7 +18,7 @@ import { suite, test } from "@testdeck/mocha";
1818import promised from "chai-as-promised" ;
1919import { expect , use } from "chai" ;
2020import { Readable } from "stream" ;
21- import { InteractionOutput } from "../src/interaction-output" ;
21+ import { InteractionOutput , ActionInteractionOutput } from "../src/interaction-output" ;
2222import { Content } from ".." ;
2323import { fail } from "assert" ;
2424
@@ -121,12 +121,20 @@ class InteractionOutputTests {
121121 }
122122 }
123123
124- @test async "should accept returning unexpected value with no validation" ( ) {
125- // type boolean should not throw since we set ignoreValidation to true
124+ @test async "should accept returning unexpected value with no validation (synchronous==false)" ( ) {
126125 const stream = Readable . from ( Buffer . from ( "not boolean" , "utf-8" ) ) ;
127126 const content = new Content ( "application/json" , stream ) ;
128127
129- const out = new InteractionOutput ( content , { } , { type : "boolean" } , { ignoreValidation : true } ) ;
128+ const out = new ActionInteractionOutput ( content , { } , { type : "boolean" } , false ) ;
129+ const result = await out . value ( ) ;
130+ expect ( result ) . to . eql ( "not boolean" ) ;
131+ }
132+
133+ @test async "should accept returning unexpected value with no validation (synchronous===undefined)" ( ) {
134+ const stream = Readable . from ( Buffer . from ( "not boolean" , "utf-8" ) ) ;
135+ const content = new Content ( "application/json" , stream ) ;
136+
137+ const out = new ActionInteractionOutput ( content , { } , { type : "boolean" } ) ;
130138 const result = await out . value ( ) ;
131139 expect ( result ) . to . eql ( "not boolean" ) ;
132140 }
0 commit comments