Closed darthzeran closed 2 years ago
I inherited some code, and when I ran the test, it failed when rewiring my application.
When the rewire rewires my file, it says
/MockedFile.js:5 key: string, ^ SyntaxError: Unexpected token : 1 | const rewire = require('rewire') 2 | 3 | const MockedFile= rewire('./MockedFile') ^
It seems to be failing on the : for flow. Is this a case to use babel-plugin-rewire? Or is there another way around it?
babel-plugin-rewire
I'm sorry, loading anything other than JavaScript is out of scope of this project. You could either use babel + babel-plugin-rewire or transform your files to plain JS before running your tests.
I inherited some code, and when I ran the test, it failed when rewiring my application.
When the rewire rewires my file, it says
It seems to be failing on the : for flow. Is this a case to use
babel-plugin-rewire
? Or is there another way around it?