Conversation
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
streamich
left a comment
There was a problem hiding this comment.
Do not use beforeEach. To setup a testbed, create a helper function like setup:
const setup = () => {
writer = new Writer();
encoder = new AvroSchemaEncoder(writer);
decoder = new AvroSchemaDecoder();
return {writer, encoder, decoder};
};Make sure linter and formatter pass.
| beforeEach(() => { | ||
| writer = new Writer(); | ||
| encoder = new AvroSchemaEncoder(writer); | ||
| decoder = new AvroSchemaDecoder(); | ||
| }); |
There was a problem hiding this comment.
Do not use beforeEach. To setup a testbed, create a helper function like setup:
| beforeEach(() => { | |
| writer = new Writer(); | |
| encoder = new AvroSchemaEncoder(writer); | |
| decoder = new AvroSchemaDecoder(); | |
| }); | |
| const setup = () => { | |
| writer = new Writer(); | |
| encoder = new AvroSchemaEncoder(writer); | |
| decoder = new AvroSchemaDecoder(); | |
| return {writer, encoder, decoder}; | |
| }; |
There was a problem hiding this comment.
Fixed in commit e27ae53. Replaced beforeEach with the suggested setup() helper function pattern. All 28 tests in AvroSchemaDecoder.spec.ts now use const {encoder, decoder} = setup() instead of relying on beforeEach.
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Fixed in commit e27ae53. Replaced |
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR implements two Apache Avro decoder classes to complement the existing encoder functionality:
AvroDecoder (Lower-level)
A low-level decoder that implements the
BinaryJsonDecoderinterface and provides methods for decoding specific Avro data types when the schema is known implicitly. Features include:AvroSchemaDecoder (Higher-level)
A schema-aware decoder that uses
AvroDecoderinternally and provides validation against Avro schemas. Features include:AvroSchemaEncoderImplementation Details
Readerclass from@jsonjoy.com/utilfor binary data readingUsage Example
Fixes #38.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.