@@ -55,7 +55,10 @@ async function runTests() {
5555 await testOutputModeIframe ( ) ;
5656 await testOutputModeDOM ( ) ;
5757 await testOutputModeHidden ( ) ;
58+
5859 await testOutputPlaceholder ( ) ;
60+ await testOutputNoTail ( ) ;
61+ await testOutputTail ( ) ;
5962
6063 await testTemplate ( ) ;
6164 await testTemplateChange ( ) ;
@@ -760,6 +763,42 @@ async function testOutputPlaceholder() {
760763 } ) ;
761764}
762765
766+ async function testOutputNoTail ( ) {
767+ return new Promise ( ( resolve , reject ) => {
768+ t . log ( "testOutputNoTail..." ) ;
769+ const ui = createSnippet ( `
770+ <pre><code>console.log("hello");
771+ console.log("---");
772+ console.log("world");</code></pre>
773+ <codapi-snippet engine="browser" sandbox="javascript" output-mode="text">
774+ </codapi-snippet>
775+ ` ) ;
776+ ui . snip . addEventListener ( "result" , ( event ) => {
777+ t . assert ( "output" , ui . output . out . innerHTML == "hello\n---\nworld" ) ;
778+ resolve ( ) ;
779+ } ) ;
780+ ui . toolbar . run . click ( ) ;
781+ } ) ;
782+ }
783+
784+ async function testOutputTail ( ) {
785+ return new Promise ( ( resolve , reject ) => {
786+ t . log ( "testOutputTail..." ) ;
787+ const ui = createSnippet ( `
788+ <pre><code>console.log("hello");
789+ console.log("---");
790+ console.log("world");</code></pre>
791+ <codapi-snippet engine="browser" sandbox="javascript" output-mode="text" output-tail>
792+ </codapi-snippet>
793+ ` ) ;
794+ ui . snip . addEventListener ( "result" , ( event ) => {
795+ t . assert ( "output" , ui . output . out . innerHTML == "world" ) ;
796+ resolve ( ) ;
797+ } ) ;
798+ ui . toolbar . run . click ( ) ;
799+ } ) ;
800+ }
801+
763802async function testTemplate ( ) {
764803 return new Promise ( ( resolve , reject ) => {
765804 t . log ( "testTemplate..." ) ;
0 commit comments