Files
pyscript/pyscriptjs/tests/unit/fakeruntime.ts
Madhur Tandon 515858f313 implement proposal for fetching paths and retaining structure of dirs and packages (#914)
* implement proposal

* update docs and replace py-env

* more docs

* suggested proposal

* update docs

* add to_file parameter

* remove comment from Makefile

* suggested improvements

* move tests from basic to py_config

* retain leading slash from the first path
2022-11-08 17:26:45 +05:30

40 lines
872 B
TypeScript

import { Runtime } from "../../src/runtime"
import type { PyodideInterface } from 'pyodide';
export class FakeRuntime extends Runtime {
src: string;
name?: string;
lang?: string;
interpreter: PyodideInterface;
globals: any;
constructor() {
super(null);
}
async run(code: string) {
/* don't do anything */
}
async loadInterpreter() {
throw new Error("not implemented");
}
registerJsModule(name: string, module: object) {
throw new Error("not implemented");
}
async loadPackage(names: string | string[]) {
throw new Error("not implemented");
}
async installPackage(package_name: string | string[]) {
throw new Error("not implemented");
}
async loadFromFile(path: string, fetch_path: string) {
throw new Error("not implemented");
}
}