test/add blueprint tests#74
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage for Plutus Blueprint (CIP-57) deserialization and provides tooling improvements for the blueprint code generation documentation. The changes include a new test suite validating Blueprint schema parsing, a sample blueprint JSON file for documentation, and a "Load Sample" feature in the blueprint codegen UI tool.
- Introduces 6 test cases covering Blueprint schema deserialization, validation, and roundtrip encoding
- Adds a comprehensive sample blueprint JSON with validators and type definitions
- Enhances the blueprint codegen UI with a "Load Sample" button for quick testing
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/evolution/test/Blueprint.test.ts | New test suite validating PlutusBlueprint schema deserialization, malformed data handling, required field validation, nested definition parsing, and roundtrip encoding/decoding |
| docs/public/sample-blueprint.json | Sample Plutus blueprint JSON with v3 validators, type definitions, and nested schemas for use in documentation and testing |
| docs/next-env.d.ts | Updated TypeScript reference path for Next.js route type definitions (potential issue with path correctness) |
| docs/app/tools/blueprint-codegen/blueprint-codegen.tsx | Added loadSample function and "Load Sample" button to populate the blueprint input with sample data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const loadSample = async () => { | ||
| try { | ||
| const response = await fetch('/sample-blueprint.json') |
There was a problem hiding this comment.
The fetch path /sample-blueprint.json uses an absolute path that will work in development but may fail in production when the site is deployed to GitHub Pages with a base path of /evolution-sdk. Consider using a relative path or constructing the path dynamically based on the environment's base path configuration to ensure the sample blueprint loads correctly in all deployment environments.
| const response = await fetch('/sample-blueprint.json') | |
| const response = await fetch('sample-blueprint.json') |
No description provided.