Skip to content

Commit 9d77ea8

Browse files
committed
chore: adjust
1 parent f1c7c65 commit 9d77ea8

File tree

1 file changed

+21
-51
lines changed

1 file changed

+21
-51
lines changed

packages/plugin-rsc/CONTRIBUTING.md

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,82 +10,52 @@ The e2e testing uses a scalable approach inspired by React Router's integration
1010

1111
#### Test Fixture Patterns
1212

13-
**1. Using existing examples directly:** See `e2e/basic.test.ts` and `e2e/starter.test.ts` for examples using `useFixture` with existing example projects.
14-
15-
**2. Creating isolated fixtures:** See `e2e/basic.test.ts` for examples using `setupIsolatedFixture` for tests that need to modify files.
16-
17-
**3. Creating inline fixtures (for specific edge cases):** See `e2e/ssr-thenable.test.ts` for examples using `setupInlineFixture` to create test-specific variations.
18-
19-
The new test structure uses:
20-
13+
- `examples/basic` as the comprehensive test suite for the RSC plugin
14+
- `examples/starter` as the lightweight base template for writing more targeted tests using `setupInlineFixture` utility
2115
- `examples/e2e/temp/` as base directory for test projects
22-
- `setupInlineFixture` utility for creating test environments
23-
- `examples/basic` as the comprehensive base (mainly used for e2e testing, includes various advanced RSC usages)
24-
- `examples/starter` as the lightweight base template for simple tests
25-
- Each test project is runnable locally
2616

2717
### Adding New Test Cases
2818

29-
**Option 1: Expanding `examples/basic` (Recommended for comprehensive features)**
19+
**Option 1: Using `setupInlineFixture` (Recommended for specific use cases)**
20+
Best for testing specific use cases. See `e2e/ssr-thenable.test.ts` for the pattern.
21+
22+
**Option 2: Expanding `examples/basic` (Recommended for comprehensive features)**
3023
Best for features that should be part of the main test suite. `examples/basic` is mainly used for e2e testing:
3124

3225
1. Add your test case files to `examples/basic/src/routes/`
3326
2. Update the routing in `examples/basic/src/routes/root.tsx`
3427
3. Add corresponding tests in `e2e/basic.test.ts`
3528

36-
**Option 2: Using `setupInlineFixture` (Recommended for specific edge cases)**
37-
Best for testing specific features or edge cases. See `e2e/ssr-thenable.test.ts` for the pattern.
29+
## Development Workflow
3830

39-
### Running Tests
31+
<!-- TODO: mention playwright vscode extension? -->
4032

4133
```bash
34+
# Build packages
35+
pnpm dev # pnpm -C packages/plugin-rsc dev
36+
37+
# Run examples
38+
pnpm -C packages/plugin-rsc/examples/basic dev # build / preview
39+
pnpm -C packages/plugin-rsc/examples/starter dev # build / preview
40+
4241
# Run all e2e tests
4342
pnpm -C packages/plugin-rsc test-e2e
4443

44+
# Run with UI (this allows filtering interactively)
45+
pnpm -C packages/plugin-rsc test-e2e --ui
46+
4547
# Run specific test file
4648
pnpm -C packages/plugin-rsc test-e2e basic
4749

4850
# Run with filter/grep
4951
pnpm -C packages/plugin-rsc test-e2e -g "hmr"
5052

51-
# Run with UI (convenient for development)
52-
pnpm -C packages/plugin-rsc test-e2e --ui
53-
54-
# Run with debug output
55-
TEST_DEBUG=1 pnpm -C packages/plugin-rsc test-e2e
56-
57-
# Skip build step (faster during development)
58-
TEST_SKIP_BUILD=1 pnpm -C packages/plugin-rsc test-e2e
59-
```
60-
61-
## Development Workflow
62-
63-
### Local Development
64-
65-
1. Make changes to plugin source code in `src/`
66-
2. Test changes using existing examples:
67-
```bash
68-
# From repo root
69-
pnpm -C packages/plugin-rsc dev
70-
# Or from plugin directory
71-
cd packages/plugin-rsc && pnpm dev
72-
```
73-
3. Run e2e tests to ensure no regressions
74-
4. Add new tests for new features using `setupInlineFixture`
75-
76-
### Test Project Debugging
77-
78-
Test projects created with `setupInlineFixture` are locally runnable:
79-
80-
```bash
81-
pnpm -C packages/plugin-rsc/examples/e2e/temp/my-test dev
53+
# Test projects created with `setupInlineFixture` are locally runnable. For example:
54+
pnpm -C packages/plugin-rsc/examples/e2e/temp/react-compiler dev
8255
```
8356

8457
## Tips
8558

86-
- Study existing test patterns in `e2e/` directory
8759
- Prefer `setupInlineFixture` for new tests - it's more maintainable and faster
88-
- Always test both dev and build modes when adding new features
89-
- Use `TEST_DEBUG=1` to see detailed output during test development
90-
- The `examples/basic` project contains comprehensive test scenarios - study it for inspiration
60+
- The `examples/basic` project contains comprehensive test scenarios
9161
- Dependencies for temp test projects are managed in `examples/e2e/package.json`

0 commit comments

Comments
 (0)