Closed rbriank closed 6 years ago
Any code which uses the spread operator in this way can't be loaded by rewire.
$ cat > test.js const profile = { a: 1, b: 2 } const other = { ...profile } $ node test.js $ $ node -v v8.9.3 $ npm i --save-dev rewire + rewire@3.0.2 $ node > const rewire = require('rewire') undefined > const test = rewire('./test.js') SyntaxError: ./test.js: Unexpected token (7:2) 5 | 6 | const other = { > 7 | ...profile | ^ 8 | } 9 |
Apparently there is a fix in the pipe for this already: #128
Any code which uses the spread operator in this way can't be loaded by rewire.