https://github.com/kirill-kolomin/ngx-testbox
Integration testing for Angular with black-box approach, async control, and user-centric testing concept
https://github.com/kirill-kolomin/ngx-testbox
angular component-testing integration-testing tdd test-driven-development testing
Last synced: 15 days ago
JSON representation
Integration testing for Angular with black-box approach, async control, and user-centric testing concept
- Host: GitHub
- URL: https://github.com/kirill-kolomin/ngx-testbox
- Owner: kirill-kolomin
- License: mit
- Created: 2025-06-28T08:59:08.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-09-09T08:33:47.000Z (about 2 months ago)
- Last Synced: 2025-09-11T01:39:48.837Z (about 2 months ago)
- Topics: angular, component-testing, integration-testing, tdd, test-driven-development, testing
- Language: TypeScript
- Homepage: https://kirill-kolomin.github.io/ngx-testbox-docs/
- Size: 390 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-angular - ngx-testbox - A comprehensive testing utility library for Angular applications that simplifies test writing and improves test reliability. You will find this library useful for unit, integration, and e2e testing. (Testing / Helpers)
- fucking-awesome-angular - ngx-testbox - A comprehensive testing utility library for Angular applications that simplifies test writing and improves test reliability. You will find this library useful for unit, integration, and e2e testing. (Testing / Helpers)
README
# Ngx-Testbox
[](https://www.npmjs.com/package/ngx-testbox)
[](https://www.npmjs.com/package/ngx-testbox)
[](https://github.com/kirill-kolomin/ngx-testbox/actions/workflows/main.yml)
[](LICENSE.txt)
**Black-box integration testing for Angular made easy.**
Ngx-testbox empowers developers to write integration tests with **minimal setup** and **maximum reliability**.
Abstract away internal implementation details and focus on what actually matters—your feature's behavior as seen by the user.
📚 Full documentation: [ngx-testbox docs](https://kirill-kolomin.github.io/ngx-testbox-docs/)
## Key Benefits
- **Black-box by design**
Focus on inputs and outputs, not the internals. Tests remain concise, maintainable, and stable.
- **Deterministic async control**
Leveraging Angular’s Zone, `ngx-testbox` waits for your app to stabilize—HTTP calls complete, DOM settled—before assertions continue.
- **UX-centric testing**
Ensure what users actually see is what matters. Internal state isn't enough if the UI doesn't reflect it.
- **Test-Driven Development friendly**
Write tests first using your REST API contract and UI expectations; implement logic later—boosts confidence and speed.
## Getting Started
```bash
npm install ngx-testbox
```
Or using yarn
```bash
yarn add ngx-testbox
```
## Quick Example
```typescript
import { fakeAsync } from '@angular/core/testing';
import { DebugElementHarness, predefinedHttpCallInstructions, runTasksUntilStable } from 'ngx-testbox/testing';
describe('MyComponent', () => {
let harness: DebugElementHarness;
beforeEach(() => {
// setup TestBed, component, and harness
});
it('should display data on success', fakeAsync(() => {
const mockData = [{ id: 1, name: 'Item A' }];
runTasksUntilStable(fixture, {
httpCallInstructions: [
predefinedHttpCallInstructions.get.success('/api/items', mockData)
]
});
const items = harness.elements.item.queryAll();
expect(items.length).toBe(1);
expect(harness.elements.itemText.getTextContent(items[0])).toContain('Item A');
}));
});
```
## Documentation & Examples
👉 Visit the full [documentation site](https://kirill-kolomin.github.io/ngx-testbox-docs/) to explore:
- Concept overviews
- Step-by-step tutorials
- Full application examples (e.g., Todo flows)
## Contributing & Support
Contributions are welcome — submit issues or PRs on GitHub.
For discussions or questions, reach out at:
- đź“§ [kkolomin.w@gmail.com](mailto:kkolomin.w@gmail.com)
- đź’Ľ [LinkedIn](https://www.linkedin.com/in/kirill-kolomin/)