Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 14:14
Show Gist options
  • Save sergueyarellano/a13184ad1e311618236dcfaf9f821e66 to your computer and use it in GitHub Desktop.
Save sergueyarellano/a13184ad1e311618236dcfaf9f821e66 to your computer and use it in GitHub Desktop.
test('isValidInterface() should take an interface model and an input object and check for type matching, with arrays', function ({ deepEqual, end }) {
const model = {
a: 'string',
b: 'object',
c: 'boolean',
d: 'number',
e: 'array'
}
const data = {
a: 'foo',
b: {},
c: true,
d: 2,
e: []
}
const actual = isValidInterface(data, model)
const expected = true
deepEqual(actual, expected)
end()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment