File tree Expand file tree Collapse file tree
internal-packages/testcontainers/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,13 +324,7 @@ const withWarmup = <T extends WarmableTestApi>(
324324 api : T ,
325325 warmUp : ( context : any ) => Promise < void >
326326) : T => {
327- let registered = false ;
328-
329327 const register = ( ) => {
330- if ( registered ) {
331- return ;
332- }
333- registered = true ;
334328 api . beforeAll ( warmUp , CONTAINER_WARMUP_TIMEOUT_MS ) ;
335329 } ;
336330
Original file line number Diff line number Diff line change 11import { describe , expect , vi } from "vitest" ;
2- import { containerTest } from "./index" ;
2+ import { clickhouseTest , containerTest } from "./index" ;
33
44vi . setConfig ( { testTimeout : 10_000 } ) ;
55
6+ describe . skip ( "a skipped suite that touches the fixture first" , ( ) => {
7+ containerTest ( "never runs" , async ( { prisma } ) => {
8+ expect ( prisma ) . toBeDefined ( ) ;
9+ } ) ;
10+ } ) ;
11+
612describe ( "container fixture warmup" , ( ) => {
713 containerTest ( "the first test is not billed for the container boot" , async ( { prisma } ) => {
814 const rows = await prisma . $queryRawUnsafe < Array < { ok : number } > > ( "SELECT 1 as ok" ) ;
@@ -16,3 +22,12 @@ describe("container fixture warmup", () => {
1622 expect ( rows [ 0 ] ?. ok ) . toBe ( 2 ) ;
1723 } ) ;
1824} ) ;
25+
26+ describe ( "worker-scoped fixtures are warmed too" , ( ) => {
27+ clickhouseTest ( "clickhouse is up before the first test" , async ( { clickhouseClient } ) => {
28+ const rs = await clickhouseClient . query ( { query : "SELECT 1 AS ok" , format : "JSONEachRow" } ) ;
29+ const rows = await rs . json < { ok : number } > ( ) ;
30+
31+ expect ( rows [ 0 ] ?. ok ) . toBe ( 1 ) ;
32+ } ) ;
33+ } ) ;
You can’t perform that action at this time.
0 commit comments