This Vue app is set up with Mirage for both local development and UI testing with Vue Test Utils.
It uses Axios for its network requests, and the test shows how to force Axios to use window.XMLHttpRequest
so Mirage can intercept the Vue app's network requests.
The Mirage server is in src/server.js. The test is in tests/unit/example.spec.js.
Pull down the repo and install deps:
git clone [email protected]:miragejs/examples.git
cd examples/vue-axios-test-utils
yarn
To run this app in development against a local Mirage server:
yarn serve
To run the Vue Test Utils test:
yarn test:unit