Created
April 3, 2017 08:55
-
-
Save probil/82cca5300c59e141a74aa3e12c4ff173 to your computer and use it in GitHub Desktop.
ipv4.test.js
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
it('Should return true for correct ipv4', () => { | |
let correctIps = [ | |
'0.0.0.0/0', | |
'255.255.255.255/32', | |
'159.12.101.0/24' | |
]; | |
let expected = {} | |
correctIps.map(ip => { | |
actual[ip] = true; | |
}) | |
let actual = {}; | |
correctIps.map(ip => { | |
actual[ip] = ipv4.isValid(ip); | |
}) | |
expect(actual).toMatchObject(expected); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment