Skip to content

[Bug]: Set isolate option to false causes some errors #777

@claneo

Description

@claneo

Version

`@rstest/core`: 0.7.4

Details

I first encountered this problem in version 0.7.3.

$ npx rstest list --isolate false
 FAIL  wasm/index.test.ts
Error: WASM file /rstest/e2e/dist/.rstest-temp/static/wasm/4f244726.module.wasm not found in asset files.
$ npx rstest --isolate false
Error: onTestFinished() can only be called inside a test

The reason may be that moduleCache is not isolated across each run.

After switch to version 0.7.4, the errors changed.

There's some build errors:

File: ./test-api/test.json:1:1
  × Module parse failed:
  ╰─▶   × JSON parse error: Unexpected character i
         ╭─[6:10]
       4 │ }
       5 │
       6 │          if (global.setupIds && __webpack_module__.id) {
         ·           ─
       7 │   global.setupIds.push(__webpack_module__.id);
       8 │ }
         ╰────
File: ./wasm/src/factorial.wasm:1:1
  × magic header not detected: bad magic number - expected=[

and runtime errors:

__rstest_dynamic_import__ is not defined

Reproduce link

none

Reproduce Steps

cd e2e && npx rstest --isolate false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions