(fn)
| 79 | |
| 80 | return it('mutates when not in player code', function() { |
| 81 | const expectMutation = function(fn) { |
| 82 | const v = new Vector(5, 5); |
| 83 | const v2 = fn(v); |
| 84 | expect(v.x).not.toEqual(5); |
| 85 | return expect(v).toBe(v2); |
| 86 | }; |
| 87 | |
| 88 | expectMutation(v => v.normalize()); |
| 89 | expectMutation(v => v.limit(2)); |