-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve relative path #57
Comments
Interesting! It may be a quick fix, would you like to try? |
Currently, the file param is relative to Mocks folder. How can we distinguish between relative to Mocks folder and mock file (.json). We have several options here:
|
We can go with the second one
but if the file is not found relative to the .json, search it relative to the Mock root path as a fallback, hence keeping backward compatibility. Although it may cause some confusion in rare cases, I don't think such fallback could cause big problems at all. Going further: Maybe it could also have a list of "hint paths" just like Visual Studio, a list of paths ordered by priority to search for mocks, when the absolute path is not known (maybe a little too much) |
Describe the bug
The
response.file
configuration should be able to resolve relative path instead of absolute path to app root. It's useful when we try to restructure the mocks folder and move the mock files often.To Reproduce
Create this mock under [app]/Mocks folder
Assuming signin.html file requires many resource files (images, javascript, css, etc), I grab those from HAR file. Because this page requires many files, so let's structure the folder and create SignIn folder under Mocks folder and move this mock file along with other mocks. Updating from Mocks/signin.html to Mocks/SignIn/signin.html is easy. But updating the rest of the mocks takes time.
Expected behavior
Introduce relative path strategy, i.e.
./
or../
let's assume it's relative to the mock (.json) fileScreenshots
The text was updated successfully, but these errors were encountered: