Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 18:50
Show Gist options
  • Save sergueyarellano/5883d445ac298c2cbe3e0086bf7b8a5d to your computer and use it in GitHub Desktop.
Save sergueyarellano/5883d445ac298c2cbe3e0086bf7b8a5d to your computer and use it in GitHub Desktop.
test('mapKeysWith() should map the keys of input object according to a template or contract', async function ({ deepEqual, end }) {
const data = { a: 1, b: 2 }
const contract = { x: 'a', y: 'b' }
const actual = mapKeysWith(data, contract)
const expected = { x: 1, y: 2 }
deepEqual(actual, expected, 'keys exist and they do not have null or undefined values')
end()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment