Do you want the latest docs? Extends Chai with assertions for the Sinon.JS mocking framework. The #1 free and open source CDN built to make life easier for developers. View more quick examples below, or dive into the API docs, which also provides useful pointers on how and when to use the various functionality. View more quick examples below, or dive into the Become a backer and support Sinon.JS with a monthly donation. Latest release 3.5.0 - Updated Feb 20, 2020 - 1.03K stars karma-sinon-chai. You’ve seen the most common tasks people tackle with Sinon.JS, yet we’ve only scratched the surface. Backers. * * Neither the name of Christian Johansen nor the names of his contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. JavaScript test spies, stubs and mocks.
We would like to show you a description here but the site won’t allow us. Current Tags BootCDN 是 猫云 联合 Bootstrap 中文网 共同支持并维护的前端开源项目免费 CDN 服务,致力于为 Bootstrap、jQuery、React、Vue.js 一样优秀的前端开源项目提供稳定、快速的免费 CDN 加速服务。 BootCDN 所收录的开源项目主要同步于 cdnjs 开源项目仓库。. [Become a backer] Sponsors. * Helps IE run the fake timers.
By defining global functions, IE allows * them to be overwritten at a later point. Or in an ES6 Modules environment (modern browsers only)The following function takes a function as its argument and returns a new function. * Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. v9.0.1 Download Docs.
v9.0.2 Download Docs. Become a sponsor and get your logo on our README on GitHub with a link to your site. Learn more about fake time. Support us with a monthly donation and help us continue our activities. If these are not defined like * this, overwriting them will result in anything from an exception to browser * If you don't require fake XHR to work in IE, don't include this file.// Reassign the original function. “I don’t always bend time and space in unit tests, but when I do, I use Buster.JS + Sinon.JS”Testing time-sensitive logic without the wait is a breeze with Sinon.JS.
Works with any unit testing framework. [Become a sponsor] Licence. Now its writable attribute See CONTRIBUTING.md for details on how you can contribute to Sinon.JS. If these are not defined like * this, overwriting them will result in anything from an exception to browser * If you don't require fake timers to work in IE, don't include this file.// Reassign the original functions. https://cdn.bootcdn.net/ajax/libs/sinon.js/9.0.2/sinon-no-sourcemaps.js Now their writable attribute * Helps IE run the fake XMLHttpRequest. Now its writable attribute * Helps IE run the fake XDomainRequest. Releases In addition to our download page, you can also use a NPM based CDN for your convenience. In this Sinon tutorial, Jani Hartikainen demonstrates how to make unit testing non-trival JavaScript code trivial with the help of spies, stubs and mocks. When testing Ajax, it is better to use Sinon.JS’ The preceding example shows how flexible this API is. If it looks too laborous, you may like the fake server:Test framework integration can typically reduce boilerplate further. To test While the preceding test shows off some nifty Sinon.JS tricks, it is too tightly coupled to the implementation. You can call the resulting function as many times as you want, but the original function will only be called once:Testing this function can be quite elegantly achieved with a The fact that the function was only called once is important:A unit test should not actually trigger a function’s network activity. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. v9.0.3 Download Docs. By defining global functions, IE allows * them to be overwritten at a later point. Some generated files are not rendered by default.