Ai assisted tests - #15
Merged
Merged
Conversation
… to inlcude tests
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#8