Files
Dawson Blackhouse 91c53144a1 feat: initial commit
2026-01-10 23:40:52 -05:00

6.6 KiB

AngularJS Unit Testing Skill - Navigation Index

Version: 1.2 | Last Updated: January 10, 2026

Quick Navigation

📚 Main Documentation

  • Skill Overview - Complete skill documentation with Jasmine + Jest support

📖 Resource Guides (Comprehensive References)

Core References

Advanced Topics

Best Practices

📝 Test Templates (Copy & Paste Ready)

🔧 Scripts

  • run-tests.sh - Test execution script with coverage support

Getting Started

For New AngularJS Projects

  1. Read Skill Overview
  2. Review Testing Patterns Guide
  3. Use templates as starting points
  4. Reference Best Practices Checklist

For Jasmine Users

  1. Start with AngularJS Testing Reference
  2. Copy templates from /templates/
  3. Follow Testing Patterns Guide

For Jest Users

  1. Read Jest Migration Guide
  2. Use Jest configuration section in Skill Overview
  3. Adapt templates as needed

For HTTP Testing

  1. Follow HTTP Mocking Guide
  2. See examples in service.spec.js

For Coverage Analysis

  1. Review Code Coverage Analysis
  2. Run tests with coverage: ./scripts/run-tests.sh --coverage

Common Tasks

Task Resource
Write controller tests controller.spec.js + Testing Patterns
Write service tests service.spec.js + HTTP Mocking Guide
Mock services Mock Helpers Guide + fixtures.js
Test HTTP calls HTTP Mocking Guide
Improve coverage Code Coverage Analysis
Quality assurance Best Practices Checklist
Migrate to Jest Jest Migration Guide
Run tests run-tests.sh

Framework Comparison

  • Browser-based testing via Karma
  • Tight AngularJS integration
  • Mature ecosystem
  • See all Jasmine content throughout resources

Jest (Modern, For New/Modern Projects)

  • Node.js-based testing
  • Fast parallel execution
  • Built-in mocking and coverage
  • Snapshot testing support
  • See Jest Migration Guide

File Organization

angularjs-unit-testing-skill/
├── README.md                          (This file)
├── skill.md                            (Main documentation)
├── resources/                          (Comprehensive guides)
│   ├── angularjs-testing-reference.md
│   ├── testing-patterns-guide.md
│   ├── http-mocking-guide.md
│   ├── mock-helpers-guide.md
│   ├── coverage-analysis-guide.md
│   ├── jest-migration-guide.md
│   └── best-practices-checklist.md
├── templates/                          (Copy-paste ready templates)
│   ├── controller.spec.js             (500+ lines, fully commented)
│   ├── service.spec.js                (600+ lines, fully commented)
│   ├── directive.spec.js
│   ├── filter.spec.js
│   └── fixtures.js                    (Mock data and helpers)
└── scripts/                            (Automation)
    └── run-tests.sh                   (Test runner with coverage)

Quick Reference

Common Test Structure (Jasmine)

describe('Component', function() {
  var component, $httpBackend;

  beforeEach(module('app'));
  beforeEach(inject(function(_Component_, _$httpBackend_) {
    component = _Component_;
    $httpBackend = _$httpBackend_;
  }));

  it('should do something', function() {
    expect(component).toBeDefined();
  });
});

Common Test Structure (Jest)

describe('Component', () => {
  let component;

  beforeEach(() => {
    component = new Component();
  });

  test('should do something', () => {
    expect(component).toBeDefined();
  });
});

Documentation Stats

  • Total Documentation: 27,500+ words
  • Code Examples: 200+ examples with dual-framework support
  • Test Templates: 5 production-ready templates (2,000+ lines)
  • Resource Guides: 7 comprehensive guides
  • Test Patterns: 8+ documented patterns
  • Coverage: Jasmine + Jest support throughout

Support & References


Version History

  • v1.2 - Added Jest migration guide and expanded mock helpers (Jan 10, 2026)
  • v1.1 - Added Jasmine + Jest dual-framework support (Jan 8, 2026)
  • v1.0 - Initial release with Jasmine-focused content (Jan 1, 2026)

Need help? Review the Best Practices Checklist or start with a template matching your component type.