refactor(scripting-revamp): migrate js-sandbox to web worker/Node vm based implementation (#3619)

This commit is contained in:
James George
2023-12-07 16:10:42 +05:30
committed by GitHub
parent 0a61ec2bfe
commit bdfa14fa54
43 changed files with 2805 additions and 3285 deletions

View File

@@ -1,6 +1,8 @@
import { pipe } from "fp-ts/function"
import * as TE from "fp-ts/TaskEither"
import { execTestScript, TestResponse, TestResult } from "../../../test-runner"
import { pipe } from "fp-ts/function"
import { runTestScript } from "~/test-runner/node-vm"
import { TestResponse, TestResult } from "~/types"
const fakeResponse: TestResponse = {
status: 200,
@@ -10,7 +12,7 @@ const fakeResponse: TestResponse = {
const func = (script: string, envs: TestResult["envs"]) =>
pipe(
execTestScript(script, envs, fakeResponse),
runTestScript(script, envs, fakeResponse),
TE.map((x) => x.tests)
)