@@ -2,6 +2,15 @@ import { writable, type Subscriber, type Writable } from 'svelte/store';
22import { afterEach , beforeEach , describe , expect , test , vi } from 'vitest' ;
33import type { PlanDataset , Profile , ProfileSegment , Resource } from '../types/simulation' ;
44
5+ // required for tests which transitively import `$env/dynamic/public` - unavailable in the vitest environment
6+ vi . mock ( '$env/dynamic/public' , ( ) => ( {
7+ env : {
8+ PUBLIC_HASURA_CLIENT_URL : 'http://test/hasura' ,
9+ PUBLIC_HASURA_SERVER_URL : 'http://test/hasura' ,
10+ PUBLIC_WORKSPACE_CLIENT_URL : 'http://test/ws' ,
11+ } ,
12+ } ) ) ;
13+
514const getExternalProfileSegmentsSinceMock = vi . fn ( ) ;
615vi . mock ( '../utilities/effects' , ( ) => ( {
716 default : {
@@ -29,7 +38,15 @@ const planDatasetsMock: PlanDatasetsMock = {
2938 subscribe : planDatasetsValue . subscribe ,
3039} ;
3140vi . mock ( './plan' , ( ) => ( {
41+ plan : writable ( { } ) ,
3242 planDatasets : planDatasetsMock ,
43+ planEndTimeDoy : writable ( '' ) ,
44+ planId : writable ( 1 ) ,
45+ planModelId : writable ( 1 ) ,
46+ planModelRevision : writable ( 1 ) ,
47+ planRevision : writable ( 1 ) ,
48+ planStartTimeMs : writable ( '' ) ,
49+ planStartTimeYmd : writable ( '' ) ,
3350} ) ) ;
3451
3552vi . mock ( './errors' , ( ) => ( {
0 commit comments