You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Find how to let the js know about whether it is running on nodejs or quickjs. Haven't found a way
Tried to let the js file directly run in quickjs for test. We'll need to write raw tests since most test framework would not in quickjs environment
Tried to use require to import different file at runtime. However quickjs doesn't support it.
Tried to use import as nodejs import syntax, error.
Tried to use import as function in quickjs, doesn't give error, but it always return empty object
Tried to mutate a module after import, but it is frozen
Some ways that might work:
Config babel in a smart way or write a babel plugin, so that it compiled using mocked host functions for test and resulting module can be tested with quickjs binary
Make a script to copy the source, prepend import * as env from 'mock-env.js to source and test
Modify quickjs.c, add runtime conditional import support
Modify jsvm.c, make it conditional compiled. For test version, all host functions are mocked
Please feel free to suggest other ways with least efforts to allow us tests!
quickjs doesn't support require, so cannot conditionally require mocked host functions to test collections
We don’t have to have this before the first release, but certain collections' functionality need at least being tested indirectly by examples
The text was updated successfully, but these errors were encountered: