Unit test codegen

Open
#233 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
testing, tooling

Research direction

Start by reading generator/client/api.test.ts around lines 68-81, which is the referenced example for testing generated code. Determine the intended scope for pure schema-to-code tests and whether ts-morph or ts-poet is relevant; done should include focused assertions that generated code is correct for representative schema chunks.

Written by the indexing model from the issue text.

Description

#231 is in the trash, but it had one part I really liked, and can't believe we didn't do before: pure functions that take in a chunk of schema and assert on the generated code!

https://github.com/oxidecomputer/oxide.ts/blob/ace6464f77eb63ab77526ec6b9627453ed5e1b3b/generator/client/api.test.ts#L68-L81

I also learned about these libraries that could give more structure to our very stringy generation code:

Dominant language
TypeScript
Stars
33
Forks
4
Avg merge
6d 9h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oxidecomputer/oxide.ts

All issues in oxidecomputer/oxide.ts

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.