# Testing Guidelines ## Unit Testing Requirements - Test files should end with `.spec.ts`. - Use Spectator for Component, Directive and Service tests. - Use Jest as the test runner. - Follow the Arrange-Act-Assert (AAA) pattern in tests. - Mock external dependencies to isolate the unit under test. ## Example Test Structure ```typescript import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { MyComponent } from './my-component.component'; describe('MyComponent', () => { let spectator: Spectator; const createComponent = createComponentFactory(MyComponent); beforeEach(() => { spectator = createComponent(); }); it('should create', () => { expect(spectator.component).toBeTruthy(); }); it('should handle action correctly', () => { spectator.setInput('inputProp', 'testValue'); spectator.click('button'); expect(spectator.component.outputProp).toBe('expectedValue'); }); }); ```