@@ -10,13 +10,14 @@ project's runtime: Bun when the project has a Bun lockfile or `"packageManager":
1010vis-agent extension install blockether/vis-lang-javascript --global --trust
1111```
1212
13- Use Vis 0.5.30 or later. Install Node 22.18 or newer with nvm or put it on ` PATH ` . Put Bun 1.4.5
14- or newer on ` PATH ` for Bun projects. A ` .nvmrc ` or ` .node-version ` file selects an installed Node
15- version from nvm. With no version file, the tools use Node on ` PATH ` or the nvm default.
13+ Use Vis 0.8.0 or later. Install Node 22.18 or newer with nvm or put it on ` PATH ` .
14+ Put Bun 1.4.5 or newer on ` PATH ` for Bun projects. A ` .nvmrc ` or ` .node-version ` file selects an
15+ installed Node version from nvm. With no version file, the tools use Node on ` PATH ` or the nvm
16+ default.
1617Install Jest or Vitest in each project that declares it in ` package.json ` . Projects without
1718either run on bun test or node: test .
1819
19- ## Use
20+ ## Use in ` py3 `
2021
2122| Tool | Purpose |
2223| --- | --- |
@@ -26,15 +27,26 @@ either run on bun test or node:test.
2627| ` js.repl_eval ` | Evaluate JavaScript or TypeScript in the active REPL. Declarations stay between calls. |
2728| ` js.repl_stop ` | Stop the project's REPL. |
2829
30+ In a Vis session, run this in ` py3 ` :
31+
2932``` python
30- js.run_tests([" src" ], keyword = " parser" )
31- js.repl_start(cwd = " apps/api" , nest = " auto" , env_file = " ../../.env" )
32- js.repl_eval(" await svc('UsersService').findOne(1)" , cwd = " apps/api" )
33+ await js.run_tests([" src" ], keyword = " parser" )
3334```
3435
3536See the [ JavaScript toolchain reference] ( docs/toolchain.md ) for runner selection, TypeScript
3637handling and REPL behavior. Results follow the [ language contract] ( https://github.com/Blockether/vis-lang-interface ) .
3738
39+ ## From your code
40+
41+ In a synchronous Vis extension callback, run the tests for the active project and read the number of failures:
42+
43+ ``` python
44+ from blockether import vis
45+
46+ result = vis.tools.js.run_tests()
47+ print (result.failed)
48+ ```
49+
3850## Development
3951
4052``` bash
0 commit comments