Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 14:18
Show Gist options
  • Save sergueyarellano/2745deeb85a33a697003994afdefb6d2 to your computer and use it in GitHub Desktop.
Save sergueyarellano/2745deeb85a33a697003994afdefb6d2 to your computer and use it in GitHub Desktop.
test('isValidInterface() should take an interface model and an input Array and check for type matching for each element', 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: []
}, {
a: 'bar',
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