Add tests for references

master
Paul Loyd 2017-10-29 16:31:43 +03:00
parent 26bd7a92a5
commit 8ce9bc35f4
1 changed files with 48 additions and 0 deletions

48
tests/references.js Normal file
View File

@ -0,0 +1,48 @@
type Type = {
a: A,
b: B[],
c: C<number>,
};
interface Interface {
a: A;
b: B[];
c: C<number>;
}
class Class {
a: A;
b: B[];
c: C<number>;
}
// ###
({
Type: {
type: 'record',
name: 'Type',
fields: [
{name: 'a', type: 'A'},
{name: 'b', type: {type: 'array', items: 'B'}},
{name: 'c', type: 'C'},
],
},
Interface: {
type: 'record',
name: 'Interface',
fields: [
{name: 'a', type: 'A'},
{name: 'b', type: {type: 'array', items: 'B'}},
{name: 'c', type: 'C'},
],
},
Class: {
type: 'record',
name: 'Class',
fields: [
{name: 'a', type: 'A'},
{name: 'b', type: {type: 'array', items: 'B'}},
{name: 'c', type: 'C'},
],
},
});