Last active
June 15, 2017 15:08
-
-
Save kirill3333/7412cc9bb3853aede59c297d194abd71 to your computer and use it in GitHub Desktop.
test for mapToArray
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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