Created
July 19, 2021 19:23
-
-
Save mauteri/14820708d18a348c473507ff4493490b to your computer and use it in GitHub Desktop.
This file contains 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
import { commaSeparatedStringToArray } from '../index'; | |
describe('commaSeparatedStringToArray', () => { | |
test('Returns array from comma separated string', () => { | |
expect(commaSeparatedStringToArray('my,unit,test')).toEqual(['my','unit','test']); | |
}); | |
test('Throws when non-string passed', () => { | |
expect(() => { | |
commaSeparatedStringToArray(5); | |
}).toThrow('Parameter was not a string.'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment