Created
June 30, 2018 18:40
-
-
Save lupomontero/7e58b20defb3462c337b76f1786100a7 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-0'); | |
describe('double', () => { | |
it('should modify array in place mutating ref declared in outer scope', () => { | |
const a = [1, 2, 3]; | |
const b = double(a); | |
expect(a).toEqual([2, 4, 6]); | |
expect(b).toEqual([2, 4, 6]); | |
expect(a).toBe(b); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment