Skip to content

Commit 37ca436

Browse files
authored
docs: Fix JS API refs internal links, update Vitest page (#666)
1 parent 0ca085b commit 37ca436

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ build-api-ref:
1515
$(PYTHON) langsmith-sdk/python/docs/create_api_rst.py
1616
LC_ALL=C $(PYTHON) -m sphinx -T -E -b html -d langsmith-sdk/python/docs/_build/doctrees -c langsmith-sdk/python/docs langsmith-sdk/python/docs langsmith-sdk/python/docs/_build/html -j auto
1717
$(PYTHON) langsmith-sdk/python/docs/scripts/custom_formatter.py langsmith-sdk/docs/_build/html/
18-
cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true --hostedBaseUrl "https://$${VERCEL_URL:-docs.smith.langchain.com}/reference/js/"
18+
cd langsmith-sdk/js && yarn && yarn run build:typedoc --useHostedBaseUrlForAbsoluteLinks true --hostedBaseUrl "https://docs.smith.langchain.com/reference/js/"
1919

2020
vercel-build: install-vercel-deps build-api-ref
2121
mkdir -p static/reference/python

docs/evaluation/how_to_guides/vitest_jest.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,41 @@ ls.describe("generate sql demo", () => {
576576
});
577577
```
578578

579+
## Configuring test suites
580+
581+
You can configure test suites with values like metadata or a custom client by passing an extra argument to
582+
`ls.describe()` for the full suite or by passing a `config` field into `ls.test()` for individual tests:
583+
584+
```ts
585+
ls.describe("test suite name", () => {
586+
ls.test(
587+
"test name",
588+
{
589+
inputs: { ... },
590+
referenceOutputs: { ... },
591+
// Extra config for the test run
592+
config: { tags: [...], metadata: { ... } }
593+
},
594+
{
595+
name: "test name",
596+
tags: ["tag1", "tag2"],
597+
skip: true,
598+
only: true,
599+
}
600+
);
601+
}, {
602+
testSuiteName: "overridden value",
603+
metadata: { ... },
604+
// Custom client
605+
client: new Client(),
606+
});
607+
```
608+
609+
The test suite will also automatically extract environment variables from `process.env.ENVIRONMENT`, `process.env.NODE_ENV` and
610+
`process.env.LANGSMITH_ENVIRONMENT` and set them as metadata on created experiments. You can then filter experiments by metadata in LangSmith's UI.
611+
612+
See [the API refs](https://docs.smith.langchain.com/reference/js/functions/vitest.describe) for a full list of configuration options.
613+
579614
## Dry-run mode
580615

581616
If you want to run the tests without syncing the results to LangSmith, you can set omit your LangSmith tracing environment variables or set

0 commit comments

Comments
 (0)