Skip to content

Instantly share code, notes, and snippets.

@lupomontero
Created June 30, 2018 18:40
Show Gist options
  • Save lupomontero/7e58b20defb3462c337b76f1786100a7 to your computer and use it in GitHub Desktop.
Save lupomontero/7e58b20defb3462c337b76f1786100a7 to your computer and use it in GitHub Desktop.
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