Skip to content

Commit 41cc371

Browse files
authored
refactor(test): update inline projects example (#362)
1 parent bfb48aa commit 41cc371

11 files changed

Lines changed: 51 additions & 32 deletions

File tree

‎examples/rstest-inline-projects/rstack.config.ts‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/rstest-inline-projects/package.json renamed to examples/test-inline-projects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@examples/rstest-inline-projects",
2+
"name": "@examples/test-inline-projects",
33
"private": true,
44
"type": "module",
55
"scripts": {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Rstack configuration guide: https://rstack.rs/config
2+
import { define } from 'rstack';
3+
4+
define.app(async () => {
5+
const { pluginReact } = await import('@rsbuild/plugin-react');
6+
return {
7+
plugins: [pluginReact()],
8+
};
9+
});
10+
11+
define.test(async () => {
12+
const { defineInlineProject } = await import('rstack/test');
13+
return {
14+
projects: [
15+
defineInlineProject({
16+
name: 'ssr',
17+
include: ['./tests/ssr.test.tsx'],
18+
testEnvironment: 'node',
19+
}),
20+
defineInlineProject({
21+
name: 'dom',
22+
include: ['./tests/dom.test.tsx'],
23+
testEnvironment: 'happy-dom',
24+
}),
25+
],
26+
};
27+
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎pnpm-lock.yaml‎

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎website/docs/en/guide/testing.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Run one project by name:
8686
rs test --project dom
8787
```
8888

89-
See [`examples/rstest-inline-projects`](https://github.com/rstackjs/rstack-cli/tree/main/examples/rstest-inline-projects) for a complete React SSR example using Node.js and happy-dom.
89+
See [`examples/test-inline-projects`](https://github.com/rstackjs/rstack-cli/tree/main/examples/test-inline-projects) for a complete React SSR example using Node.js and happy-dom.
9090

9191
### External projects
9292

0 commit comments

Comments
 (0)