Skip to content

Ai assisted tests - #15

Merged
HamzaHassanain merged 30 commits into
masterfrom
ai-assisted-tests
May 2, 2026
Merged

Ai assisted tests#15
HamzaHassanain merged 30 commits into
masterfrom
ai-assisted-tests

Conversation

@HamzaHassanain

@HamzaHassanain HamzaHassanain commented Jan 2, 2026

Copy link
Copy Markdown
Owner

#8

HamzaHassanain and others added 30 commits January 2, 2026 14:17
…to ai-assisted-tests

# Conflicts:
#	.gitignore
#	.npmignore
#	src/helpers/checker.ts
#	src/helpers/generator.ts
#	src/helpers/validator.ts
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mocks helpers/* and executor heavily; covers all 49 exported step
functions across template, validator, generator, solution, verification,
and Polygon-remote workflows. Skips stepPromptCreateProblem and
stepGetValidProblemName (interactive readline via dynamic import).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers all 18 exported action functions with happy and error paths;
multi-branch actions (generate, validate, runSolution) cover
all/testset/group/index branches; remotePush covers existing-problem,
new-problem confirmed/cancelled, missing-component, and selective
component branches. Mocks steps, polygon, formatter, helpers/*.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers every public method on PolygonSDK across general, problem-info,
statements, checker/validator/interactor, validator/checker tests,
files, solutions, scripts, tests, tags/desc/tutorial, packages, and
contest endpoints. Adds deterministic SHA-512 signature vectors plus
envelope-parsing and FAILED-response tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cli.ts: every wired command (new, download-testlib, list, generate,
validate, run, test, verify, remote *) and the custom --help callback
are exercised via mocked actions module. help.ts: 10 new tests in a
new file capturing console.log output and asserting header, command
signatures, options, aliases, and recursive subcommand printing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SDK mocked via mapped type over the 7 methods viewer.ts uses; fmt
mocked via FmtMockShape with explicit this:void to avoid unbound-method.
Domain literals use real FilesResponse/Package/ProblemInfo/Solution/
Statement/Test types. No any, no eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers all 7 exported uploads (solutions, checker, validator,
generators, statements, metadata, testsets) plus updateProblemInfo,
including missing-resource and partial-failure paths. SDK typed via
MockedSdk + asConfig helper through unknown. No any, no eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers all 6 exported pulls (solutions, checker, validator, generators,
statements, testsets) plus fetchProblemMetadata, including manual +
generator commands with groups/points, language fallbacks, and CRLF
normalization. SDK typed via mapped MockedFunction<PolygonSDK[K]> with
asSdk(...) helper. No any, no eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers all 12 exports across line-ending normalizers, polyman directory,
credentials, SDK init, problem-info fetch and formatting, problem-id
resolution, and package-type validation. fs mocks typed via PathLike /
PathOrFileDescriptor; Problem fixtures from src/types. No any, no
eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mockSpawn typed as MockedFunction<typeof spawn>; MockChild interface
extends EventEmitter and routes through asChildProcess; ExecutorPrivate
interface replaces 'as any' for spying on private methods; ESRCH error
typed as Error & { code?: string }. No any, no eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
formatter, script-parser, create-template, testlib-download, testset,
and utils test files re-typed: vi.mocked / MockedFunction / vi.spyOn
in const, real types from src/types.d.ts (LocalSolution, LocalGenerator,
LocalTestset, GeneratorScriptCommand, etc.), typed Dirent[] and
PathLike fs callbacks. No any, no eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
checker, generator, solution, and validator test files re-typed:
shared makeConfig / makeExecResult / buildConfig factories return real
ConfigFile / ExecutionResult; bracket-access aliases on
vi.mocked(module) sidestep unbound-method while preserving mock
identity; ExecutionOptions / ExecutionResult callbacks typed; fs.copyFile
and fs.readFile mocks typed via PathLike + NodeJS.ErrnoException.
No any, no eslint-disable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HamzaHassanain
HamzaHassanain merged commit ee2e97c into master May 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant