angularjs-unit-testing

审查 · 45
已收录

Use this skill for AngularJS unit testing, maintenance, and migration tasks

Verified installs0
Stars14
版本1.0.0
质量59/100 · 有潜力
信任45/100 · Do not auto-install
审计69/100 · 需审查

供给资产档案

编程与开发 Agent

代码审查、仓库分析、测试、CI、GitHub、DevOps 与开发工作流 Skill。

浏览赛道

场景

Testing and QA

I need my agent to test a web app, reproduce bugs, and verify fixes.

适配 Agent

Claude Code + Browser agents + CLI

适用于 Codex、Claude Code、Cursor、CLI 或自定义 Agent。

安装

就绪

npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing

维护状态

新鲜

今天有推送

风险

需审查

Dependency or permission surface needs review

GitHub 质量

14

59/100 质量 · 57/100 信任

覆盖标签

编程Testing and QA编程 Agentagent-skill

审查说明

Dependency or permission surface needs review · Permission surface may require sandboxing

Agent 采用评分卡

一眼查看信任、审计与安装准备度

这些分数综合公开仓库元数据、OpenAgentSkill 审查信号、维护新鲜度与安装准备度。它用于候选筛选,不替代人工审查。

质量

有潜力
59

有用的候选项,但采用前应与替代方案比较。

信任

Do not auto-install
45

Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.

审计

需审查
69

对安装准备度、安全元数据、维护情况与采用风险的机器可读审查。

OpenAgentSkill 信任评分 v5

安装前需人工审查

Choose a stronger alternative or inspect the source manually before any install attempt.

CodexClaude CodeCursorOpenAgentSkill CLI

Stars

14 个 GitHub Stars

仓库活跃度

14 个 Star,1 个 Fork

维护状态

今天有推送

许可证

MIT

安装

npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing

安装安全性

标准软件包或运行时安装路径

权限范围

secrets or environment access, shell or command execution

Agent 结果

暂未有 Agent 结果数据

文档

Usable metadata, review docs

风险摘要

需要高强度审查

  • The SKILL.md excerpt appears truncated at 'Test Organization' – ensure the full document is present and complete.
  • Financial research output is not financial advice; require human review before any live investment decision.
  • Low GitHub adoption signal
  • Quality score needs review

安装准备度

安装路径可用

  • 安装路径可用
  • 仓库证据可用
  • 已声明许可证
  • 暂无 Agent 验证结果证据

Agent 可读元数据

这个 Skill 的机器可读决策数据。

使用此区块或内嵌 JSON 判断 Agent 是否应安装该 Skill、选择替代方案,或先请求人工审查。

打开 JSON

适用任务

  • Browser automation 工作流
  • Claude Code 团队
  • builders willing to evaluate younger projects
  • Navigate pages

适用 Agent

CodexClaude CodeCursorOpenAgentSkill CLIBrowser agentsCLI

安装决策

命令
npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing
策略
阻止
人工审查

信任与风险

信任
45/100
审计
69/100
风险级别
需审查

结果闭环

端点
/api/agent/outcome
事件 ID
resolve
结果
5

安装命令

npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing

不适用场景

  • 需要厂商支持 SLA 的团队
  • production agents without a repository review
  • Low GitHub adoption signal
  • The SKILL.md excerpt appears truncated at 'Test Organization' – ensure the full document is present and complete.
  • 暂未有 OpenAgentSkill 使用反馈数据

Agent 安全 v2

21/100 · 避免自动安装

Blocked for auto-install阻止

This skill should not be selected by an agent without explicit human security review.

Do not auto-install. Inspect the source, dependencies, and permission surface first.

通过 API 解析

Shell 或命令执行

Skill 元数据引用了终端、CLI、Shell、子进程或命令执行工作流。

Browser automation

Skill may drive a browser or interact with web pages.

网络访问

Skill 可能访问远程页面、API、仓库或外部服务。

文件系统访问

Skill 可能读取或写入项目文件、文档、生成产物或本地工作区状态。

  • 高风险权限提示:Shell or command execution, Secrets or environment access
  • Dependency or permission surface needs review

安装目标

在你的 Agent 工作流中安装此 Skill

通过公开安装端点获取命令、安全清单、目标提示词和该 Skill 的规范链接。

skill install

OpenAgentSkill CLI

Resolve policy, run the source installer safely, and report a verified install receipt.

$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install greedychipmunk-angularjs-unit-testing

Agent 解析计划

让 Agent 在安装前验证匹配度。

Resolve API 返回首选 Skill、替代方案、安全策略、审计说明、安装目标和可直接执行的提示词,无需抓取此页面。

打开文本计划

Agent 应检查

  • 从 Resolve API 检查任务匹配与替代方案。
  • 检查审计评分、信任评分和安全策略警告。
  • 检查 Codex、Claude Code、Cursor 或 CLI 的安装目标兼容性。

复制提示词

Task: Use angularjs-unit-testing in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20angularjs-unit-testing%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/greedychipmunk-angularjs-unit-testing/install
Install command: npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Agent 交接

把安装路径交给 Agent,而不是再给一个目录页。

通过公开安装端点获取命令、安全清单、目标提示词和该 Skill 的规范链接。

打开安装 API

Agent 提示词

Use angularjs-unit-testing for this task. Review https://www.openagentskill.com/api/skills/greedychipmunk-angularjs-unit-testing/install, then install with: npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing

Registry 元数据

用于自动选择 Skill 的 Agent 可读档案。

本页通过 Registry API 提供相同的决策、信任、审计、场景和安装信号,让 Agent 无需抓取界面即可排序。

打开 Manifest

适配 Agent

58/100

Browser automation

平台

Claude Code, Browser agents

审计报告

需审查 · 69/100

对安装准备度、安全元数据、维护情况与采用风险的机器可读审查。

查看审计报告查看评估报告

Agent 决策面板

Fallback candidate for Browser automation

先用此 Skill 做原型验证,并保留备选方案。

58
就绪度
原型验证
阶段

栈中角色

备选候选

主要匹配

Browser automation

信任标签

先做原型验证

安装路径

命令已就绪

适用场景

  • Browser automation 工作流
  • Claude Code 团队
  • builders willing to evaluate younger projects

证据

  • 仓库近期活跃
  • 已提供安装命令或 GitHub 仓库
  • 59/100 质量档案

先审查

  • Low GitHub adoption signal
  • The SKILL.md excerpt appears truncated at 'Test Organization' – ensure the full document is present and complete.
  • 暂未有 OpenAgentSkill 使用反馈数据

实施路径

  1. 1在沙盒 Agent 中安装它,并端到端完成一次Browser automation任务。
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

信任档案

Do not auto-install

Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.

45
OpenAgentSkill 信任评分

GitHub 采用度

修复

14 个 GitHub Stars

Star/Fork 活跃度

修复

14 个 Star,1 个 Fork; 当前元数据中没有议题活跃度信息

近期维护

通过

今天有推送

许可证清晰度

通过

MIT

积极信号

  • AI 审查已通过
  • 安装路径可用
  • 仓库证据可用
  • 近期维护的仓库
  • 安装命令未发现明显高风险模式
  • 结果闭环已就绪,但需要首次真实 Agent 运行

安装前审查

  • The SKILL.md excerpt appears truncated at 'Test Organization' – ensure the full document is present and complete.
  • Financial research output is not financial advice; require human review before any live investment decision.
  • Low GitHub adoption signal
  • Quality score needs review
  • Permission surface needs review: secrets or environment access, shell or command execution
  • GitHub adoption: 14 GitHub stars
  • Stars/forks activity: 14 stars, 1 forks; issue activity unavailable in current metadata
  • Dependency/runtime risk: command execution surface, credential or environment access
  • Permission surface: secrets or environment access, shell or command execution
  • 暂未有真实 Agent 结果报告
  • 无人值守安装前需要人工审查

建议操作

Choose a stronger alternative or inspect the source manually before any install attempt.

质量档案

有潜力 适用于 Agent 工作流的候选

有用的候选项,但采用前应与替代方案比较。

59
GitHub Stars
14
新鲜度
今天
安装就绪
许可证
MIT
安装前审查: Low GitHub adoption signal · The SKILL.md excerpt appears truncated at 'Test Organization' – ensure the full document is present and complete.

工作流匹配

在这些场景使用此 Skill

工作流匹配

加入完整工作流

替代方案短名单

安装前对比

可能适合该任务的相近 Skill。

对比全部

概览

--- name: angularjs-unit-testing description: Use this skill for AngularJS unit testing, maintenance, and migration tasks ---

# AngularJS Unit Testing Skill

## Overview

This skill specializes in writing, refactoring, and maintaining high-quality unit tests for AngularJS (1.x) applications. It covers controllers, services, filters, directives, HTTP mocking, promises, and dependency injection — everything you need to keep an AngularJS codebase well-tested and reliable.

> **Note**: AngularJS reached end-of-life in December 2021. It receives only critical security fixes. New projects should use Angular 19+. For teams maintaining AngularJS codebases, this skill provides the latest testing patterns, tooling, and migration guidance. See [Migration Path](#migration-path-angularjs--angular) at the bottom of this document.

## Skill Capabilities

### Core Testing Competencies

- **Controllers**: Write tests for controller logic, state management, and event handling - **Services**: Test factory/service dependencies, HTTP calls, and business logic - **Filters**: Validate filter transformations and edge cases - **Directives**: Test directive compilation, linking, and DOM manipulation - **HTTP Mocking**: Mock HTTP calls using `$httpBackend` (Jasmine/Karma) or MSW/fetch mocks (Jest) - **Promises & Async**: Handle `$q`, deferred objects, and `$timeout` - **Dependency Injection**: Test with mocked and real dependencies - **Scope Management**: Test scope lifecycle, watchers, and event broadcasting - **Coverage Analysis**: Generate and interpret code coverage reports - **Test Organization**: Structure tests following best practices and maintainability principles - **Framework Choice**: Jest for new work and hybrid repos; Jasmine/Karma for existing suites

### Testing Patterns

This skill implements the following testing patterns:

1. **AAA Pattern (Arrange-Act-Assert)** - Organize tests with clear setup, execution, and verification phases - Improves readability and maintainability

2. **Mocking & Spying** - Use Jasmine spies or Jest mocks to mock functions and verify calls - Mock HTTP responses and service dependencies - Simulate user interactions

3. **Test Fixtures** - Create reusable test data and helper functions - Use beforeEach/afterEach for common setup/teardown - Reduce test duplication

4. **Edge Case Testing** - Test boundary conditions, empty states, and error scenarios - Validate error handling and graceful degradation - Test asynchronous operations and race conditions

5. **Snapshot Testing** (Jest) - Capture expected component output - Detect unintended changes in UI rendering

6. **Deterministic Async** - Prefer fake timers, controlled promises, and isolated state over timing-sensitive assertions

## Testing Frameworks & Test Runners

### Jasmine (Legacy Default)

Jasmine remains the safest choice when you are preserving an existing AngularJS + Karma suite.

**Key Concepts**: - `describe()`: Group related tests into a test suite - `it()`: Define individual test cases - `expect()`: Create assertions - `beforeEach()` / `afterEach()`: Setup and teardown hooks - `spyOn()` / `jasmine.createSpy()`: Mock functions and track calls

**Setup**: ```bash npm install --save-dev jasmine karma karma-jasmine karma-chrome-launcher ```

**Use when**: - You are maintaining an existing Jasmine/Karma suite - You want the smallest possible change set for legacy AngularJS code

### Jest (Recommended)

Jest is the modern default for AngularJS test maintenance and migration work. It runs tests in parallel, has stronger mocking APIs, supports snapshots, and includes built-in coverage reporting.

**Key Concepts**: - `describe()`: Group related tests - `test()` or `it()`: Define individual test cases - `expect()`: Create assertions - `beforeEach()` / `afterEach()`: Setup and teardown hooks - `jest.fn()`: Create mock functions - `jest.spyOn()`: Spy on existing methods - `jest.mock()`: Mock modules

**Setup**: ```bash npm install --save-dev jest jest-preset-angular angular-mocks npm install @angular/core ```

**Jest Configuration** (`jest.config.js`): ```javascript module.exports = { preset: 'jest-preset-angular', testEnvironment: 'jsdom', setupFilesAfterEnv: ['<rootDir>/setup-jest.js'], transform: { '^.+\.js$': 'babel-jest' }, collectCoverage: true, collectCoverageFrom: ['src/**/*.js', '!src/**/*.spec.js'] }; ```

**Use when**: - You want faster feedback from parallel execution - You need better mocking, snapshots, and coverage out of the box - You are preparing an AngularJS codebase for an Angular migration

### Karma (Legacy Runner)

Karma is the legacy browser test runner traditionally paired with Jasmine. It is still usable for existing suites, but it has seen no major releases since 2021 and should not be the basis for new investment.

**Configuration**: - `karma.conf.js`: Main configuration file - Specifies browser environment, files to load, and plugins - Supports code coverage reporting and CI integration

## Jest Migration Guide

Use these steps when moving an AngularJS test suite from Jasmine/Karma to Jest:

1. **Install the core tooling** ```bash npm install --save-dev jest jest-preset-angular angular-mocks npm install @angular/core ``` Add `@angular/core` when the repo is hybrid or actively migrating toward Angular.

2. **Create a Jest setup file** - Add `setup-jest.js` or `setup-jest.ts` - Load `angular`, `angular-mocks`, and any shared test polyfills there

3. **Configure Jest for AngularJS files** - Use `jest.config.js` with `testEnvironment: 'jsdom'` - Add a transform for legacy JavaScript sources - Keep template or DOM-specific setup in the Jest bootstrap file

4. **Load AngularJS modules in Jest** ```javascript beforeEach(() => { require('angular'); require('angular-mocks'); angular.mock.module('myApp'); }); ```

5. **Migrate spies and stubs** - `spyOn(obj, 'method')` → `jest.spyOn(obj, 'method')` - `jasmine.createSpy()` → `jest.fn()` - `jasmine.createSpyObj()` → `jest.fn()` or explicit mock objects

6. **Replace `$httpBackend` where practical** - Prefer `fetch` mocks or MSW for new Jest tests - Keep `$httpBackend` only for legacy tests that are expensive to rewrite immediately

7. **Reset state between tests** - Use `jest.clearAllMocks()` / `jest.resetAllMocks()` - Recreate AngularJS modules and services in `beforeEach()`

## Handling Environmental Flakiness

Legacy AngularJS suites often fail because the environment is unstable, not because the code is broken.

**Common sources of flakiness**: - Timing issues and race conditions - Shared state between tests - Browser environment differences - Network-dependent tests and real external services - Time zone, locale, and date-sensitive logic

**Deterministic test patterns**: - Use fake timers for scheduled work and debounce/throttle logic - Keep async work controlled with explicit promise resolution and digest flushing - Reset shared state, mocks, and module caches in `afterEach()` - Avoid real browser/network dependencies in unit tests - Prefer fixed test data over generated or time-based values

**js-env-sanitizer pattern**: - Snapshot and restore environment-dependent globals around each test - Isolate `window`, `document`, `localStorage`, `Date`, `Math.random`, feature flags, and DOM mutations - This is especially useful in long-lived AngularJS suites where hidden environment coupling causes intermittent failures

## Test Pyramid Guidance for Legacy Codebases

Legacy AngularJS codebases often have an inverted test pyramid: too many end-to-end tests and too few unit tests.

**Recommended shape**: - **Base**: many fast unit tests for controllers, services, filters, and directives - **Middle**: fewer integration tests for module wiring, routing, and API boundaries - **Top**: a small number of end-to-end tests for critical user journeys only

**Guidance**: - Shift coverage toward unit tests first - Keep integration tests as the middle layer, not the base - Use e2e tests sparingly because they are slower and more environment-sensitive

## Test Structure

### Jasmine Test Structure (Legacy Default)

All Jasmine tests follow this standard structure:

```javascript describe('Component Name', function() { var componentUnderTest, dependencies;

beforeEach(module('myApp'));

beforeEach(inject(function($injector) { componentUnderTest = $injector.get('ComponentName'); dependencies = $injector.get('DependencyName'); }));

afterEach(function() { // Cleanup code });

describe('Functionality Group', function() { it('should do something specific', function() { // Arrange var input = 'test';

// Act var result = componentUnderTest.method(input);

// Assert expect(result).toBe('expected'); }); }); }); ```

### Jest Test Structure (Recommended)

Jest tests follow a similar structure with modern mocking and cleaner teardown:

```javascript describe('Component Name', () => { let componentUnderTest; let dependency;

beforeEach(() => { jest.clearAllMocks(); // Setup code or mock initialization dependency = { method: jest.fn() }; componentUnderTest = require('./component'); });

afterEach(() => { // Cleanup code });

describe('Functionality Group', () => { test('should do something specific', () => { // Arrange const input = 'test';

// Act const result = componentUnderTest.method(input, dependency);

// Assert expect(result).toBe('expected'); }); }); }); ```

**Key Differences**: - Jest uses `jest.fn()` / `jest.spyOn()` instead of Jasmine spies for modern test code - Jest uses `test()` or `it()` (both work) - Jest auto-discovers `.spec.js` and `.test.js` files - Jest provides built-in snapshot testing and code coverage

## Best Practices

### 1. Test Organization - One test file per component (e.g., `controller.spec.js` for `controller.js`) - Organize tests into logical groups using `describe()` - Use meaningful test names that describe expected behavior

### 2. DRY Principle (Don't Repeat Yourself) - Extract common setup into `beforeEach()` blocks - Create reusable test data fixtures - Use helper functions to reduce duplication

### 3. Test Independence - Each test should be independent and runnable in any order - Clean up resources in `afterEach()` - Avoid shared state between tests

### 4. Realistic Mocks - Mock external dependencies realistically - Use actual data structures when possible - Avoid overly simplified or unrealistic mocks

### 5. Comprehensive Coverage - Aim for 80%+ code coverage - Test happy paths, edge cases, and error scenarios - Test async operations and race conditions

### 6. Performance - Keep tests fast - Use in-memory mocks instead of real HTTP requests - Avoid unnecessary database operations

### 7. Maintainability - Write tests that are easy to understand - Use the AAA pattern for clarity - Document complex test logic with comments - Refactor tests when the component changes

## Common Testing Scenarios

### Testing Controllers

```javascript describe('UserController', function() { var $scope, controller;

beforeEach(module('myApp')); beforeEach(inject(function($controller, $rootScope) { $scope = $rootScope.$new(); controller = $controller('UserController', { $scope: $scope }); }));

it('should initialize with default values', function() { expect($scope.users).toBeDefined(); });

it('should load users on init', function() { expect($scope.users.length).toBeGreaterThan(0); }); }); ```

### Testing Services

```javascript describe('UserService', function() { var userService, $httpBackend;

beforeEach(module('myApp')); beforeEach(inject(function(_UserService_, _$httpBackend_) { userService = _UserService_; $httpBackend = _$httpBackend_; }));

afterEach(function() { $httpBackend.ver

技术详情

版本
1.0.0
许可证
MIT
最近更新
2026年8月22日
发布时间
2026年8月22日

决策摘要

备选候选

58
就绪
原型验证
阶段

仓库近期活跃

审计

安装审查

安装与采用审查

69
需审查
安全性
66/100
维护状态
100/100
安装
92/100
打开完整审计查看评估报告

Agent 验证证据

Agent 验证证据

来自解析、审查、安装和一次小范围运行后的结果报告。

0
已验证
Needs first agent run自动安装: 先审查最近: 未知
成功率
近期失败
结果
0
输出质量
失败
0
不相关
0
安装次数
0
风险拦截
0
需要配置
0
生产环境
0

暂时没有 Agent 结果数据。首次 Agent 执行可以通过 /api/agent/outcome 报告成功、需要设置、风险拦截、失败或不相关。

安装

加入 Agent 工作流

免费且开源. 在生产 Agent 中安装前请先审查报告。

增长闭环

分享工具包

X

为 angularjs-unit-testing 准备的场景化草稿,可手动发布到 X。

策展说明
Before you hand an agent a repeatable workflow, give it a repeatable starting point.

angularjs-unit-testing: Use this skill for AngularJS unit testing, maintenance, and migration tasks

14 stars

https://www.openagentskill.com/skills/greedychipmunk-angularjs-unit-testing?ref=x
打开 X 草稿
可选:带安装命令的回复
Listing + install path for angularjs-unit-testing:
https://www.openagentskill.com/skills/greedychipmunk-angularjs-unit-testing?ref=x

Install: npx skills add greedychipmunk/agent-skills --skill angularjs-unit-testing
打开回复草稿

收录来源

Registry 收录

可认领

此列表来自公开来源,维护者认领获批前不会标记为官方。

收录方
OpenAgentSkill 社区索引

归属链接指向公开仓库或创作者主页。创作者可认领列表以更新所有权信号。

认领此 Skill

所有者认领

认领此 Skill 页面

这条 Registry 收录 列表归属于 greedychipmunk,但尚未标记为官方。认领后可增加已验证所有者信号,使后续发布、安装和审计更新更值得信赖。

创作者外链工具包

将证据徽章加入你的 README

在开发者评估仓库的位置展示规范页面、当前信任与审计信号,以及真实的 Agent 验证证据。

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/greedychipmunk-angularjs-unit-testing?metric=listed&label=Listed)](https://www.openagentskill.com/skills/greedychipmunk-angularjs-unit-testing)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/greedychipmunk-angularjs-unit-testing?metric=trust&label=Trust)](https://www.openagentskill.com/skills/greedychipmunk-angularjs-unit-testing)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/greedychipmunk-angularjs-unit-testing?metric=audit&label=Audit)](https://www.openagentskill.com/skills/greedychipmunk-angularjs-unit-testing/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/greedychipmunk-angularjs-unit-testing?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/greedychipmunk-angularjs-unit-testing)

作者

G

greedychipmunk

@greedychipmunk

健康信号

GitHub Stars
14
质量评分
32/100
最近 GitHub 推送
2026年8月22日
框架提示
未知
OpenAgentSkill 浏览量
0
复制安装命令
0
跳转点击
0

社区信号

告诉我们这个 Skill 是否对你的 Agent 工作流有帮助。汇总反馈会持续改善排序。

信任与安全

Do not auto-install

45
  • GitHub 采用度14 个 GitHub Stars修复
  • Star/Fork 活跃度14 个 Star,1 个 Fork; 当前元数据中没有议题活跃度信息修复
  • 近期维护今天有推送通过
  • 许可证清晰度MIT通过
  • README/SKILL.md 完整度公开元数据需要更完整的 README/SKILL.md 上下文信息
  • 依赖与运行时风险command execution surface, credential or environment access修复