@@ -94,6 +94,7 @@ function stubProvider(componentName: string): string {
9494}
9595
9696describe ( "Tier SC — Sample component" , ( ) => {
97+ beforeEach ( journalBeforeEach ( "packages/core/tests/sample-component.test.ts" ) ) ;
9798 beforeAll ( ( ) => useTempFileCompiler ( ) ) ;
9899 // SC1: Self-closing with prompt — prompt sent to Sample Api
99100 it ( "SC1: self-closing with prompt — response in output" , function * ( ) {
@@ -116,7 +117,7 @@ describe("Tier SC — Sample component", () => {
116117 ] . join ( "\n" ) ,
117118 } ) ;
118119
119- const stream = new InMemoryStream ( ) ;
120+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
120121 const output = yield * collect (
121122 yield * execute ( {
122123 path : path . join ( tmpDir , "doc.md" ) ,
@@ -162,7 +163,7 @@ describe("Tier SC — Sample component", () => {
162163 ] . join ( "\n" ) ,
163164 } ) ;
164165
165- const stream = new InMemoryStream ( ) ;
166+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
166167 const output = yield * collect (
167168 yield * execute ( {
168169 path : path . join ( tmpDir , "doc.md" ) ,
@@ -203,7 +204,7 @@ describe("Tier SC — Sample component", () => {
203204 ] . join ( "\n" ) ,
204205 } ) ;
205206
206- const stream = new InMemoryStream ( ) ;
207+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
207208 const output = yield * collect (
208209 yield * execute ( {
209210 path : path . join ( tmpDir , "doc.md" ) ,
@@ -230,7 +231,7 @@ describe("Tier SC — Sample component", () => {
230231 "doc.md" : '<Sample prompt="no provider" />' ,
231232 } ) ;
232233
233- const stream = new InMemoryStream ( ) ;
234+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
234235 const execution = yield * execute ( {
235236 path : path . join ( tmpDir , "doc.md" ) ,
236237 stream,
@@ -310,7 +311,7 @@ describe("Tier SC — Sample component", () => {
310311 ] . join ( "\n" ) ,
311312 } ) ;
312313
313- const stream = new InMemoryStream ( ) ;
314+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
314315 const output = yield * collect (
315316 yield * execute ( {
316317 path : path . join ( tmpDir , "doc.md" ) ,
@@ -349,7 +350,7 @@ describe("Tier SC — Sample component", () => {
349350 ] . join ( "\n" ) ,
350351 } ) ;
351352
352- const stream = new InMemoryStream ( ) ;
353+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
353354 const output = yield * collect (
354355 yield * execute ( {
355356 path : path . join ( tmpDir , "doc.md" ) ,
@@ -396,7 +397,7 @@ describe("Tier SC — Sample component", () => {
396397 ] . join ( "\n" ) ,
397398 } ) ;
398399
399- const stream = new InMemoryStream ( ) ;
400+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
400401 const output = yield * collect (
401402 yield * execute ( {
402403 path : path . join ( tmpDir , "doc.md" ) ,
@@ -706,6 +707,7 @@ describe("Tier RC — renderChildren and render closures", () => {
706707} ) ;
707708
708709describe ( "Tier IN — Instruction component" , ( ) => {
710+ beforeEach ( journalBeforeEach ( "packages/core/tests/sample-component.test.ts" ) ) ;
709711 beforeAll ( ( ) => useTempFileCompiler ( ) ) ;
710712 // IN1: Instruction enriches Sample context with instructions
711713 it ( "IN1: Instruction enriches Sample context" , function * ( ) {
@@ -733,7 +735,7 @@ describe("Tier IN — Instruction component", () => {
733735 ] . join ( "\n" ) ,
734736 } ) ;
735737
736- const stream = new InMemoryStream ( ) ;
738+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
737739 const output = yield * collect (
738740 yield * execute ( {
739741 path : path . join ( tmpDir , "doc.md" ) ,
@@ -766,7 +768,7 @@ describe("Tier IN — Instruction component", () => {
766768 ] . join ( "\n" ) ,
767769 } ) ;
768770
769- const stream = new InMemoryStream ( ) ;
771+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
770772 const output = yield * collect (
771773 yield * execute ( {
772774 path : path . join ( tmpDir , "doc.md" ) ,
@@ -808,7 +810,7 @@ describe("Tier IN — Instruction component", () => {
808810 ] . join ( "\n" ) ,
809811 } ) ;
810812
811- const stream = new InMemoryStream ( ) ;
813+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
812814 const output = yield * collect (
813815 yield * execute ( {
814816 path : path . join ( tmpDir , "doc.md" ) ,
@@ -840,7 +842,7 @@ describe("Tier IN — Instruction component", () => {
840842 ] . join ( "\n" ) ,
841843 } ) ;
842844
843- const stream = new InMemoryStream ( ) ;
845+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
844846 const output = yield * collect (
845847 yield * execute ( {
846848 path : path . join ( tmpDir , "doc.md" ) ,
@@ -855,6 +857,7 @@ describe("Tier IN — Instruction component", () => {
855857} ) ;
856858
857859describe ( "Tier AG — Agent component pattern" , ( ) => {
860+ beforeEach ( journalBeforeEach ( "packages/core/tests/sample-component.test.ts" ) ) ;
858861 beforeAll ( ( ) => useTempFileCompiler ( ) ) ;
859862 // AG1: Agent component installs instruction middleware + Content
860863 it ( "AG1: agent component with instruction middleware" , function * ( ) {
@@ -899,7 +902,7 @@ describe("Tier AG — Agent component pattern", () => {
899902 ] . join ( "\n" ) ,
900903 } ) ;
901904
902- const stream = new InMemoryStream ( ) ;
905+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
903906 const output = yield * collect (
904907 yield * execute ( {
905908 path : path . join ( tmpDir , "doc.md" ) ,
@@ -979,7 +982,7 @@ describe("Tier AG — Agent component pattern", () => {
979982 ] . join ( "\n" ) ,
980983 } ) ;
981984
982- const stream = new InMemoryStream ( ) ;
985+ const stream = yield * useJournalStream ( path . join ( tmpDir , "doc.md" ) ) ;
983986 const output = yield * collect (
984987 yield * execute ( {
985988 path : path . join ( tmpDir , "doc.md" ) ,
0 commit comments