Skip to content

Instantly share code, notes, and snippets.

@kirill3333
Last active June 15, 2017 15:08
Show Gist options
  • Save kirill3333/7412cc9bb3853aede59c297d194abd71 to your computer and use it in GitHub Desktop.
Save kirill3333/7412cc9bb3853aede59c297d194abd71 to your computer and use it in GitHub Desktop.
test for mapToArray
describe('mapToArray: converts map -> array', () => {
it('should return empty array for empty map', () => {
const testMap = new Map()
const expectedResult = []
const result = mapToArray(testMap)
assert.equal(expectedResult, result)
})
it('should return array with key/value from map', () => {
const testMap = new Map()
testMap.set('key', 'value')
const expectedResult = [['key', 'value']]
const result = mapToArray(testMap)
assert.equal(expectedResult, result)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment