File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ export async function sendBatchRequest(
1010 options : PocketBaseLoaderBaseOptions ,
1111 superuserToken : string
1212) : Promise < any > {
13- await enableBatchApi ( options , superuserToken ) ;
14-
1513 const batchRequest = await fetch ( new URL ( `api/batch` , options . url ) , {
1614 method : "POST" ,
1715 headers : {
@@ -26,7 +24,7 @@ export async function sendBatchRequest(
2624 return batchRequest . json ( ) ;
2725}
2826
29- async function enableBatchApi (
27+ export async function enableBatchApi (
3028 options : PocketBaseLoaderBaseOptions ,
3129 superuserToken : string
3230) : Promise < void > {
Original file line number Diff line number Diff line change 11import { assert } from "vitest" ;
22import type { TestProject } from "vitest/node" ;
33import { getSuperuserToken } from "../src/utils/get-superuser-token" ;
4+ import { enableBatchApi } from "./_mocks/batch-requests" ;
45import { checkE2eConnection } from "./_mocks/check-e2e-connection" ;
56import { createLoaderOptions } from "./_mocks/create-loader-options" ;
67
@@ -38,6 +39,9 @@ export async function setup(project: TestProject): Promise<void> {
3839
3940 // Provide superuser token to tests
4041 project . provide ( "superuserToken" , token ) ;
42+
43+ // Enable batch API for e2e tests
44+ await enableBatchApi ( options , token ) ;
4145}
4246
4347declare module "vitest" {
You can’t perform that action at this time.
0 commit comments