Test Writing Workflow
iOfficeAI/AionUi
Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.
Test doubles with Vitest (vi.fn, vi.mock, vi.spyOn) and Mother pattern.
$ npx skills add macalbert/envilder --skill typescript-test-doubles -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install macalbert/envilder typescript-test-doubles --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/typescript-test-doubles .claude/skills/typescript-test-doubles && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "typescript-test-doubles" agent skill from https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doubles into .claude/skills/typescript-test-doubles/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-test-doubles", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doublesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add macalbert/envilder --skill typescript-test-doubles -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install macalbert/envilder typescript-test-doubles --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/typescript-test-doubles .agents/skills/typescript-test-doubles && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "typescript-test-doubles" agent skill from https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doubles into .agents/skills/typescript-test-doubles/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-test-doubles", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add macalbert/envilder --skill typescript-test-doubles -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install macalbert/envilder typescript-test-doubles --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/typescript-test-doubles .cursor/skills/typescript-test-doubles && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "typescript-test-doubles" agent skill from https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doubles into .cursor/skills/typescript-test-doubles/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-test-doubles", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/macalbert/envilder.git --path .github/skills/typescript-test-doubles--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add macalbert/envilder --skill typescript-test-doubles -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install macalbert/envilder typescript-test-doubles --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/typescript-test-doubles .gemini/skills/typescript-test-doubles && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "typescript-test-doubles" agent skill from https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doubles into .gemini/skills/typescript-test-doubles/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-test-doubles", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install macalbert/envilder typescript-test-doublesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add macalbert/envilder --skill typescript-test-doubles -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/typescript-test-doubles .github/skills/typescript-test-doubles && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "typescript-test-doubles" agent skill from https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doubles into .github/skills/typescript-test-doubles/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-test-doubles", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add macalbert/envilder --skill typescript-test-doubles -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install macalbert/envilder typescript-test-doubles --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/typescript-test-doubles .opencode/skills/typescript-test-doubles && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "typescript-test-doubles" agent skill from https://github.com/macalbert/envilder/tree/main/.github/skills/typescript-test-doubles into .opencode/skills/typescript-test-doubles/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typescript-test-doubles", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
typescript-test-doublesTest doubles with Vitest (vi.fn, vi.mock, vi.spyOn) and Mother pattern.
Typescript Test Doubles is an agent skill from macalbert/envilder. Test doubles with Vitest (vi.fn, vi.mock, vi.spyOn) and Mother pattern. Use when creating test data, mocking dependencies, or setting up module mocks in TypeScript tests.
Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Unit testing. It works with TypeScript and Vitest. The repository describes itself as: One secret mapping for local dev, CI/CD, and runtime. Envilder resolves cloud secrets from your own vaults without SaaS middlemen, duplicated config, or .env drift. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit b6a0327. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Typescript Test Doubles loads about 1.2k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 216 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from macalbert/envilder at commit b6a0327, republished under its MIT licence (© macalbert). 216 words, ~1,204 tokens.
.claude/skills/typescript-test-doubles/SKILL.md (or your agent's skills folder).This skill defines how to use test doubles in TypeScript (Vitest).
Use vi.fn() to create mock functions for port interfaces.
Purpose: Replace real dependencies with controllable test doubles.
const mockProvider: ISecretProvider = {
getSecret: vi.fn(),
};
const mockStore: IVariableStore = {
getMapping: vi.fn(),
saveEnvironment: vi.fn(),
};
const mockLogger: ILogger = {
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
};Use return value methods to configure stubs.
Purpose: Predefined responses without caring about call verification.
// Async stub
mockProvider.getSecret.mockResolvedValue('secret-value');
mockStore.getMapping.mockResolvedValue({ KEY: '/ssm/path' });
// Sync stub
mockParser.parse.mockReturnValue({ config: {}, mappings: {} });
// Sequential returns
mockProvider.getSecret
.mockResolvedValueOnce('first')
.mockResolvedValueOnce('second');Use vi.spyOn() to observe calls on real objects without replacing behavior.
Purpose: Verify interactions while preserving real implementation.
const spy = vi.spyOn(console, 'log');
sut.execute();
expect(spy).toHaveBeenCalledWith('Processing...');
spy.mockRestore();Use vi.mock() to replace entire modules.
Purpose: Replace external dependencies (AWS SDK, file system, etc.).
vi.mock('@aws-sdk/client-ssm', () => ({
SSMClient: vi.fn().mockImplementation(() => ({
send: vi.fn(),
})),
GetParameterCommand: vi.fn(),
}));Use mockRejectedValue() to simulate failures.
Purpose: Test error paths and exception handling.
mockProvider.getSecret.mockRejectedValue(
new ParameterNotFoundError('/missing/key'),
);
mockStore.getMapping.mockRejectedValue(
new Error('File not found'),
);expect(mockProvider.getSecret).toHaveBeenCalledWith('/ssm/path');
expect(mockProvider.getSecret).toHaveBeenCalledTimes(1);
expect(mockLogger.info).toHaveBeenCalledWith(
expect.stringContaining('success'),
);expect(mockStore.saveEnvironment).not.toHaveBeenCalled();
expect(mockLogger.error).not.toHaveBeenCalled();expect(mockProvider.getSecret).toHaveBeenCalledBefore(
mockStore.saveEnvironment,
);expect(mockLogger.info).toHaveBeenCalledWith(
expect.stringMatching(/loaded \d+ secrets/),
);
expect(mockStore.saveEnvironment).toHaveBeenCalledWith(
expect.objectContaining({ KEY: 'value' }),
);Use factory functions for reusable test data creation.
function createParsedMapFile(
overrides: Partial<ParsedMapFile> = {},
): ParsedMapFile {
return {
config: { provider: 'aws' },
mappings: new Map([['DB_URL', '/app/db']]),
...overrides,
};
}
function createEnvilderOptions(
overrides: Partial<EnvilderOptions> = {},
): EnvilderOptions {
return {
provider: SecretProviderType.AWS,
profile: undefined,
vaultUrl: undefined,
...overrides,
};
}Usage:
// Arrange
const mapFile = createParsedMapFile({
mappings: new Map([['API_KEY', '/prod/api-key']]),
});Build complete mock objects implementing domain interfaces:
function createMockSecretProvider(): ISecretProvider & {
getSecrets: Mock;
} {
return {
getSecrets: vi.fn().mockResolvedValue(new Map()),
};
}
function createMockLogger(): ILogger & {
info: Mock;
warn: Mock;
error: Mock;
} {
return {
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
};
}| Double Type | Vitest API | Purpose |
|---|---|---|
| Mock | vi.fn() | Controllable replacement |
| Stub | .mockResolvedValue() / .mockReturnValue() | Predefined responses |
| Spy | vi.spyOn() | Observe real objects |
| Module mock | vi.mock() | Replace entire modules |
| Error sim | .mockRejectedValue() | Failure paths |
When writing tests:
vi.fn() in beforeEach.mockResolvedValue() in Arrangevi.fn() over vi.mock() (port-level > module-level)© macalbert, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/typescript-test-doubles of macalbert/envilder.
Open the folder on GitHubat commit b6a0327
Typescript Test Doubles next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Typescript Test Doubles this skillmacalbert/envilder | 138 | — | ~1.2k | Automated safety check: Pass | MIT | |
| Test Writing WorkflowiOfficeAI/AionUi | 33k | 1 repos | ~1.2k | Automated safety check: Pass | Apache-2.0 | |
| Creating A Packagec15t/c15t | 1.9k | — | ~913 | Automated safety check: Pass | Apache-2.0 | |
| Svelte Testingspences10/sveltest | 113 | — | ~579 | Automated safety check: Pass | MIT | |
| Effect TStellahq/opensession | 392 | — | ~3.7k | Automated safety check: Pass | MIT | |
| Ha Frontend Testinghome-assistant/frontend | 5.7k | — | ~1.7k | Automated safety check: Pass | Apache-2.0 |
iOfficeAI/AionUi
Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.
c15t/c15t
Scaffold a new workspace package in the c15t monorepo. An agent skill from c15t/c15t.
spences10/sveltest
Fix and create Svelte 5 tests with vitest-browser-svelte and Playwright.
tellahq/opensession
Write idiomatic Effect v4 TypeScript verified against the pinned effect@4.0.0-rc.112 source.
home-assistant/frontend
Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.
antfu-collective/eslint-vitest-rule-tester
Help users test ESLint rules with Vitest, supporting snapshot testing and custom assertions
macalbert/envilder
Five independent analysis perspectives for code review: correctness, architecture, security, conventions, and complexity.
macalbert/envilder
Index of Architecture Decision Records (ADRs) for cross-cutting technical decisions.
macalbert/envilder
Git commit messages, PR workflow, and branching strategy using Conventional Commits and Semantic Versioning.
macalbert/envilder
Mandatory testing conventions including the narrow diagnostic exception for testing test-only code, AAA pattern, test naming, and assertions across all stacks (.NET, TypeScript, Python).
macalbert/envilder
Workflow for maintaining changelogs, READMEs, and documentation files.
macalbert/envilder
Audit and synchronize documentation across website, READMEs, and docs/.
Works with
Categories
Test doubles with Vitest (vi.fn, vi.mock, vi.spyOn) and Mother pattern. Typescript Test Doubles is an agent skill from macalbert/envilder.spyOn) and Mother pattern.
Typescript Test Doubles fits situations like: creating test data; mocking dependencies; setting up module mocks in TypeScript tests.
Run `npx skills add macalbert/envilder --skill typescript-test-doubles -a claude-code`. Or copy the skill folder (.github/skills/typescript-test-doubles in macalbert/envilder) into .claude/skills/typescript-test-doubles in your project. Claude Code loads it when a task matches its description.
Run `npx skills add macalbert/envilder --skill typescript-test-doubles -a codex`. Or copy the skill folder (.github/skills/typescript-test-doubles in macalbert/envilder) into .agents/skills/typescript-test-doubles in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add macalbert/envilder --skill typescript-test-doubles -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript-test-doubles, .gemini/skills/typescript-test-doubles, .github/skills/typescript-test-doubles and .opencode/skills/typescript-test-doubles in your project.
Going by SKILL.md and its folder, Typescript Test Doubles needs credentials named API_KEY. Our summary lists: A credential in API_KEY.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Typescript Test Doubles is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Typescript Test Doubles: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Creating A Package (c15t/c15t, 1.9k stars), Svelte Testing (spences10/sveltest, 113 stars) and Effect TS (tellahq/opensession, 392 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
macalbert (a GitHub user) maintains it in macalbert/envilder, which has 138 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 5, 2026.
Source: macalbert/envilder on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.