Fix and enable integration tests in CI (#721)

* run jest only inside node + fix indexURL for integration tests

* add integration tests to CI

* use pytest from env
This commit is contained in:
Madhur Tandon
2022-08-25 22:01:05 +05:30
committed by GitHub
parent 7aa25712d9
commit 47494e62a7
3 changed files with 10 additions and 9 deletions

View File

@@ -15,17 +15,15 @@ export class PyodideRuntime extends Runtime {
async loadInterpreter(): Promise<void> {
console.log('creating pyodide runtime');
// eslint-disable-next-line
// @ts-ignore
let extraOpts: any = {}
if (inJest()) {
extraOpts = {indexURL: [process.cwd(), 'node_modules', 'pyodide'].join('/') }
}
let indexURL: string = this.src.substring(0, this.src.length - "/pyodide.js".length)
if (typeof process === 'object' && inJest()) {
indexURL = [process.cwd(), 'node_modules', 'pyodide'].join('/')
}
this.interpreter = await loadPyodide({
stdout: console.log,
stderr: console.log,
fullStdLib: false,
...extraOpts
indexURL
});
this.globals = this.interpreter.globals;