Open spooler opened 5 years ago
same issue on osx
Was having this same issue and the problem for me was in how I declared the path to my mocks.
In short, I was setting up the mockserver like this:
mockserver("./path/to/mocks")
and the problem was caused by the leading ./
, so just removing that solved the problem for me:
mockserver("path/to/mocks")
The reason this breaks the wildcard matching is because it strips off the base directory from the wildcard filepaths (https://github.com/namshi/mockserver/blob/200ede1a6e3de9562c3f9caaea20a9203e907e0a/mockserver.js#L175), but it does this by calculating the number of path segments in the base directory and removing them from the wildcard filepaths. However if your base directory includes the leading ./
it will be counted as an additional segment and therefore no matches will be found.
Don't know if this is the reason for the issues above but just putting it here for anyone else who comes across the same problem I did.
mockserver 3.0.0
file:
request:
expected server output:
got: