-
Notifications
You must be signed in to change notification settings - Fork 3
cli‐zimic‐browser
github-actions[bot] edited this page Mar 3, 2025
·
2 revisions
zimic-interceptor browser
contains commands to manage browser mock configuration.
Initialize the browser service worker configuration.
zimic-interceptor browser init <publicDirectory>
Positionals:
publicDirectory The path to the public directory of your application.
[string] [required]
This command is necessary to use Zimic in a browser environment. It creates a mockServiceWorker.js
file in the
provided public directory, which is used to intercept requests and mock responses.
If you are using Zimic mainly in tests, we recommend adding the mockServiceWorker.js
to your .gitignore
and adding
this command to a postinstall
scripts in your package.json
. This ensures that the latest service worker script is
being used after upgrading Zimic.
© Zimic
Docs |
Issues | Examples |
Roadmap
Help us improve these docs!
Report an issue or
edit on GitHub.