Skip to content

Commit f770bcd

Browse files
ashleyshawclaude
andcommitted
test: Add placeholder test files for comprehensive script coverage
Ensures every .js file in scripts/ has corresponding .test.js file in __tests__ subfolder. This establishes complete test coverage structure across the codebase. Created tests for: - Agent scripts (3 files): generate-plugin, release, release-scaffold - Lib scripts (6 files): config-schema, logger, mode-detector with full and targeted tests - Utils scripts (9 files): audit-frontmatter, check-markdown-references, count-tokens, fix-instruction-references, scan-mustache-variables, update-version, components, entry, hooks, test-placeholders - Validation scripts (5 files): validate-mustache-registry, validate-plugin-config, validate-block-json, block-json, block-schema - Root-level scripts (13 files): agent-script, audit-frontmatter, build, count-tokens, dry-run-config, dry-run-test, scan-mustache-variables, test-dry-run, test-mustache-schema, test-placeholders, update-version, validate-mustache-registry, validate-plugin-config Total: 38 test files created/modified Each test contains placeholder structure with TODO comments for implementation. Tests follow Jest conventions with __tests__ subdirectory organization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 8fad1a1 commit f770bcd

38 files changed

+766
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Agent Script
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Agent Script', () => {
9+
test('placeholder - agent script tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for agent-script.js
12+
});
13+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Audit Frontmatter
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Audit Frontmatter', () => {
9+
test('placeholder - audit frontmatter tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for audit-frontmatter.js
12+
});
13+
});

scripts/__tests__/build.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Build Script
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Build Script', () => {
9+
test('placeholder - build script tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for build.js
12+
});
13+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Count Tokens
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Count Tokens', () => {
9+
test('placeholder - count tokens tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for count-tokens.js
12+
});
13+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Tests for Dry Run Config (root)
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Dry Run Config (root)', () => {
9+
test('placeholder - dry run config tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for dry-run-config.js
12+
// Note: Main tests are in scripts/dry-run/__tests__/
13+
});
14+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Dry Run Test
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Dry Run Test', () => {
9+
test('placeholder - dry run test tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for dry-run-test.js
12+
});
13+
});

scripts/__tests__/generate-plugin.agent.test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { spawn } = require('child_process');
1010

1111
jest.mock('fs');
1212

13-
const AGENT_SCRIPT = path.join(__dirname, '../generate-plugin.agent.js');
13+
const AGENT_SCRIPT = path.join(__dirname, '../agents/generate-plugin.agent.js');
1414

1515
/* eslint-disable jsdoc/check-line-alignment */
1616
/**
@@ -59,6 +59,10 @@ describe('generate-plugin.agent.js', () => {
5959
fs.writeFileSync = jest.fn();
6060
fs.existsSync = jest.fn().mockReturnValue(false);
6161
fs.readFileSync = jest.fn();
62+
console.log.mockClear();
63+
console.info.mockClear();
64+
console.warn.mockClear();
65+
console.error.mockClear();
6266
});
6367

6468
describe('Command Line Arguments', () => {
@@ -68,13 +72,15 @@ describe('generate-plugin.agent.js', () => {
6872
expect(result.stdout).toContain('Usage:');
6973
expect(result.stdout).toContain('Interactive:');
7074
expect(result.stdout).toContain('With JSON:');
75+
expect(console).toHaveLogged();
7176
});
7277

7378
it('prints the schema when --schema is supplied', async () => {
7479
const result = await runAgent(['--schema']);
7580
expect(result.code).toBe(0);
7681
expect(result.stdout).toContain('"$schema"');
7782
expect(result.stdout).toContain('"type": "object"');
83+
expect(console).toHaveLogged();
7884
});
7985
});
8086

@@ -89,6 +95,7 @@ describe('generate-plugin.agent.js', () => {
8995
const result = await runAgent(['--json'], { input: validConfig });
9096
expect(result.code).toBe(0);
9197
expect(result.stderr).toBe('');
98+
expect(console).toHaveLogged();
9299
});
93100

94101
it('rejects invalid JSON that is provided via stdin', async () => {
@@ -97,6 +104,7 @@ describe('generate-plugin.agent.js', () => {
97104
});
98105
expect(result.code).not.toBe(0);
99106
expect(result.stderr).toContain('Invalid JSON');
107+
expect(console).toHaveErrored();
100108
});
101109

102110
it('validates structure while running in JSON mode', async () => {
@@ -110,6 +118,7 @@ describe('generate-plugin.agent.js', () => {
110118
});
111119
expect(result.code).not.toBe(0);
112120
expect(result.stderr).toContain('required');
121+
expect(console).toHaveErrored();
113122
});
114123
});
115124

@@ -127,6 +136,7 @@ describe('generate-plugin.agent.js', () => {
127136
result.stdout.includes(symbol)
128137
);
129138
expect(hasSuccessIndicator).toBe(true);
139+
expect(console).toHaveLogged();
130140
});
131141

132142
it('fails when the configuration format is invalid', async () => {
@@ -137,6 +147,7 @@ describe('generate-plugin.agent.js', () => {
137147

138148
const result = await runAgent(['--validate', invalidConfig]);
139149
expect(result.code).not.toBe(0);
150+
expect(console).toHaveErrored();
140151
});
141152
});
142153
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Scan Mustache Variables
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Scan Mustache Variables', () => {
9+
test('placeholder - scan mustache variables tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for scan-mustache-variables.js
12+
});
13+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Test Dry Run
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Test Dry Run', () => {
9+
test('placeholder - test dry run tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for test-dry-run.js
12+
});
13+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Tests for Test Mustache Schema
3+
*
4+
* @package multi-block-plugin-scaffold
5+
* @since 1.0.0
6+
*/
7+
8+
describe('Test Mustache Schema', () => {
9+
test('placeholder - test mustache schema tests to be implemented', () => {
10+
expect(true).toBe(true);
11+
// TODO: Implement actual tests for test-mustache-schema.js
12+
});
13+
});

0 commit comments

Comments
 (0)