The jQuery Mockjax Plugin provides a simple and extremely flexible interface for mocking or simulating ajax requests and responses
See PR #361. This release does not change the source code, but because the development dependencies have been updated (and they were very out of date), the minified version has changed significantly.
You should test thoroughly if you use the minified version of Mockjax!
This release fixes a minor bug encountered with testing with jQuery 3.4.1 with the capitalization of headers.
This release fixes some issues with the automated Browserstack testing and adds an option to reorder the mock handlers from first-in to last-in.
This update adds a new feature: an array of status codes in the mock response.
It also updates the entire test suite to using Chrome Headless for the automated tests rather than PhantomJS since it has been deprecated.
This is a patch release to include testing for jQuery 3.x and some testing and documentation around tools like Browserify and webpack. Also included is an update to the keywords in the package.json
file to (hopefully) get us back into the jQuery plugin registry.
This release brings with it numerous bug fixes, both to the source code and the tests. There are also a few new features added to the API:
$.mockjaxSettings.retainAjaxCalls = false;
console
uses. This makes it interact with other logging options such as Winston much cleaner.data
property matching to be a function, and thus dynamic (thanks to @koorgoo)This release fixes a number of small bugs that had been waiting for some time (see the CHANGELOG) for more information. The newest 1.x branch of jQuery was also added to our test suite, and tests were reorganized to make them easier to maintain and to test specific features with.
This version includes a big update to the QUnit tests and the testing setup. In addition to updating the QUnit version, we're now using the new API and the tests are a bit more mainatainable and easier to find. Additionally, there were some bug fixes for cross domain requests and proxy data. And we have a new feature: global URL namespaces!
Thanks to @danpaz you can now do:
$.mockjaxSettings.namespace = "/api/v1";
$.mockjax({
url: "/rest"
});
$.mockjax({
url: "/foobar"
});
$.ajax({
url: '/api/v1/rest',
// ...
});
$.ajax({
url: '/api/v1/foobar',
// ...
});
Many thanks to the folks that helped with the work in this release: @danpaz, @stas-vilchik, @udnisap, @gyoshev, @LeopoldoFu, @r4j4h, and @ScottONeal
Apparently when we published the 2.0.0-beta the name in the package.json
file was "jquery.mockjax" ... Unfortunately this was a mistake. The name does in fact follow popular convention of hyphenated names in npm (and bower). Thus we have changed the name and deprecated the old package on npm.