-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Just tried to use this package, but ran into a problem.
I tried
const Swift = require("swift-mock");
const swift = new Swift();
But it fails with something like
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at new Swift (/whatever/node_modules/swift-mock/lib/swift.js:19:33)
I had a look in the code. At
Line 19 in 9cc7326
this.fieldPatterns = JSON.parse(patterns); |
JSON.parse is done on patterns. But patterns already is an object and it fails.
Same thing at
Line 9 in 9cc7326
this.fieldPatterns = fieldPatterns ? JSON.parse(fieldPatterns) : patterns; |
After I changed that I could parse my Swift file. I am sitting on
npx node --version
v10.15.1
leonjza
Metadata
Metadata
Assignees
Labels
No labels