The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Ported genql 3.0.5 test suite
Port of the test suite of remorses/genql
at @genql/[email protected] (commit 4a547db46a9a614cc2b5958e28674af351898464), the
version the codegen in ../../genql was vendored from. It protects the
vendored engine's behavior; the engine's output bytes are pinned by
../genql-engine-output.test.ts and by the checked-in fixture/generated/
client (generated-fixture-drift.test.ts).
| Here | Upstream |
|---|---|
fixture/schema.graphql |
integration-tests/schema.graphql (byte-verbatim) |
fixture/generated/ |
output of the vendored engine for that schema, checked in so type-level assertions compile; pinned by generated-fixture-drift.test.ts |
generate-queries.test.ts |
integration-tests/tests/simple.ts |
execute-queries.test.ts |
integration-tests/tests/execution.ts |
type-selection.test.ts |
cli/src/typeSelection.test.ts |
type-map.test.ts |
cli/src/render/typeMap/index.test.ts |
render-typing.test.ts |
cli/src/render/common/__tests__/renderTyping.test.ts |
comment.test.ts |
cli/src/render/common/__tests__/comment.test.ts |
render-context.test.ts |
cli/src/render/common/__tests__/RenderContext.test.ts |
render-schema.test.ts |
cli/src/render/schema/renderSchema.test.ts |
render-test-helpers.ts |
cli/src/testHelpers/render.ts |
Not ported: parse.test.ts and printer.test.ts (they cover CLI/printer code
Twenty did not vendor) and the subscription suite (already skipped upstream).
Adaptations
Selections, resolvers, assertions and test names are upstream's. What changed:
- mocha/sucrase/snap-shot-it → vitest. Snapshots are vitest snapshots.
- apollo-server (v3, deprecated) → graphql-js execution.
execution.tsbooted a real HTTP server per test;execute-queries.test.tsruns the same resolvers throughgraphql()behind an injectedfetch/fetcher, which exercises the identical client code path with no network and no new dependency. - tsd
expectType→ vitestexpectTypeOf, strengthened to exact. Upstream's CI did typecheck its integration tests (itsgenstep rantsc --noEmitover tests plus a freshly generated client), but it never ran the tsd CLI — and under plain tsc, tsd'sexpectType<T>(value)degrades to an assignability check. Several assertions were therefore looser than the real types. The exact assertions here pin what the 3.0.5 engine actually generates (fields absent from a response areundefined, nevernull;__typenameis a literal type) and are enforced by the package typecheck. type-map.test.tsassertions enabled. Upstream ran them in output-logging mode with stale expected values; the values here match the engine's actual output.