Skip to content

Commit

Permalink
test: check equivalence of generated Protobuf messages types
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Dec 13, 2023
1 parent 8ecefe6 commit bdaef0c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/protobuf/tests/schema-equivalent.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Messages from '../src/messages';
import * as MessagesSchema from '../src/messages-schema';

// Checks deep equality of two types
type EQ<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;

describe('schema types are equivalent to protobuf', () => {
it('MessageType type is equivalent', () => {
type CheckEq = EQ<Messages.MessageType, MessagesSchema.MessageType>;
const checkEq: CheckEq = true;
expect(checkEq).toBe(true);
});
});

0 comments on commit bdaef0c

Please sign in to comment.