Created
June 30, 2018 18:41
-
-
Save lupomontero/2f36dd0c24a4d8ec53250a2e730fe0e0 to your computer and use it in GitHub Desktop.
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
const double = require('./double-1'); | |
describe('double', () => { | |
it('should create new array without mutating ref declared in outer scope', () => { | |
const a = [1, 2, 3]; | |
const b = double(a) | |
expect(a).toEqual([1, 2, 3]); | |
expect(b).toEqual([2, 4, 6]); | |
expect(a).not.toBe(b); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment