I have a JSON object that is being parsed, and I'm writing tests for the output and I wan't to be able to check if a specific object conforms to a flow type, at runtime.
const object = {/**/}
type SomeType = {
foo: string,
bar: bool,
baz: Object,
}
describe('object', () => {
describe('.subfield', () => {
it('conforms to SomeType', () => {
// Here I want to write an 'expect'
// that checks if object.subfield
// conforms to the SomeType flow type?
})
});
});
Is there any way this is achievable?
Aucun commentaire:
Enregistrer un commentaire