Skip to content

Commit 7cbe816

Browse files
committed
docs: Add missing imports to documentation examples in TESTING_GUIDE.md and add test:update-snapshots script
1 parent aa6b17b commit 7cbe816

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

docs/testing/TESTING_GUIDE.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ The Theater System provides a complete development and testing environment.
4444

4545
```typescript
4646
import { Stage, Laboratory, Hypothesis } from '@synapse-framework/core';
47+
import { MyComponent } from './my-component'; // Placeholder for example component
48+
import { UserService } from './user-service'; // Placeholder for example service
4749

4850
// Create a stage
4951
const stage = new Stage({
@@ -80,6 +82,7 @@ await lab.runAll();
8082
```typescript
8183
import { NeuralNode } from '@synapse-framework/core';
8284
import { describe, it, expect } from '@jest/globals';
85+
import { UserService } from './user-service'; // Placeholder for example service
8386

8487
describe('UserService', () => {
8588
let service: UserService;
@@ -139,6 +142,7 @@ describe('UserService', () => {
139142

140143
```typescript
141144
import { Stage, Laboratory, Hypothesis, TestSubject } from '@synapse-framework/core';
145+
import { UserService } from './user-service'; // Placeholder for example service
142146

143147
describe('UserService (Theater)', () => {
144148
const stage = new Stage({ title: 'UserService Tests' });
@@ -188,7 +192,8 @@ describe('UserService (Theater)', () => {
188192
### Testing Muscles (Pure Functions)
189193

190194
```typescript
191-
import { Muscle } from '@synapse-framework/core';
195+
import { Muscle, Bone } from '@synapse-framework/core';
196+
import { z } from 'zod';
192197

193198
describe('DataTransform Muscle', () => {
194199
const transform = new Muscle(
@@ -428,6 +433,8 @@ import {
428433
TCell,
429434
BCell,
430435
} from '@synapse-framework/core';
436+
import { UserService } from './user-service'; // Placeholder for example service
437+
import { EmailService } from './email-service'; // Placeholder for example service
431438

432439
describe('User Registration Flow', () => {
433440
let heart: Heart;
@@ -510,6 +517,7 @@ describe('User Registration Flow', () => {
510517

511518
```typescript
512519
import { Stage, Laboratory } from '@synapse-framework/core';
520+
import { Database, setupTestDatabase, teardownTestDatabase } from './database-utils'; // Placeholder for example database utilities
513521

514522
describe('Database Integration', () => {
515523
const stage = new Stage({ title: 'DB Tests' });
@@ -610,6 +618,8 @@ test('should receive real-time updates', async ({ page }) => {
610618
### Pattern 1: Arrange-Act-Assert
611619

612620
```typescript
621+
import { UserService } from './user-service'; // Placeholder for example service
622+
613623
it('should process user data', async () => {
614624
// Arrange
615625
const service = new UserService();
@@ -647,6 +657,9 @@ lab.experiment('user creation', async () => {
647657
### Pattern 3: Test Fixtures
648658

649659
```typescript
660+
import crypto from 'crypto';
661+
import { TCell } from '@synapse-framework/core';
662+
650663
class TestFixtures {
651664
static async createUser(overrides = {}) {
652665
return {
@@ -734,6 +747,7 @@ class MockEmailService {
734747
return { success: true };
735748
}
736749
}
750+
import { UserService } from './user-service'; // Placeholder for example service
737751

738752
it('should send welcome email', async () => {
739753
const mockEmail = new MockEmailService();
@@ -804,6 +818,7 @@ describe('Performance', () => {
804818

805819
```typescript
806820
import { Stage, PerformanceProfiler, SignalTracer, HealthMonitor } from '@synapse-framework/core';
821+
import { myService } from './my-service'; // Placeholder for example service
807822

808823
describe('Service Performance', () => {
809824
const stage = new Stage({ title: 'Performance Tests' });

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"test:bun": "bun test",
1616
"test:watch": "jest --watch",
1717
"test:coverage": "jest --coverage",
18+
"test:update-snapshots": "jest --updateSnapshot",
1819
"test:e2e": "playwright test",
1920
"test:e2e:ui": "playwright test --ui",
2021
"test:e2e:debug": "playwright test --debug",

0 commit comments

Comments
 (0)