Skip to content

Commit

Permalink
docs: improve Node.js binding's test doc (#5159)
Browse files Browse the repository at this point in the history
* docs: improve Node.js binding's test doc

Signed-off-by: tison <[email protected]>

* for vscode integration

Signed-off-by: tison <[email protected]>

* fix build unstable

Signed-off-by: tison <[email protected]>

---------

Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Oct 6, 2024
1 parent fa23e1f commit 83a05b9
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 71 deletions.
19 changes: 19 additions & 0 deletions bindings/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ pnpm run build:theme
pnpm run docs
```

## Tests

Services behavior tests read necessary configs from env vars or the `.env` file.

You can copy [.env.example](/.env.example) to `$(pwd)/.env` and change the values on need, or directly set env vars with `export KEY=VALUE`.

Take `fs` for example, we need to enable bench on `fs` on `/tmp`:

```properties
OPENDAL_TEST=fs
OPENDAL_FS_ROOT=/tmp
```

You can run service behavior tests of enabled with the following command:

```shell
pnpm build && pnpm test
```

## Usage

```javascript
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"prettier": "^2.8.4",
"typedoc": "^0.25",
"typescript": "^5.0.2",
"vitest": "^0.34.6"
"vitest": "^1.6.0"
},
"engines": {
"node": ">= 10"
Expand Down
Loading

0 comments on commit 83a05b9

Please sign in to comment.