chaijs / chai-change Goto Github PK
View Code? Open in Web Editor NEWAssert that a change you expected to happen, happened, with this chai plugin
Assert that a change you expected to happen, happened, with this chai plugin
var x = 0;
expect(function() { x += 1; }).to.change(function() { return x });
expect(function() { }).not.to.change(function() { return x });
error:
AssertionError: expected [Function] to have a property undefined
at Assertion.assertChanges (node_modules/chai/lib/chai/core/assertions.js:1604:40)
at Assertion.assert (node_modules/chai/lib/chai/utils/addChainableMethod.js:83:49)
Hi,
The current version of this plugin on npm does not accept asynchronous assertions.
I recommend you use semantic versioning for your npm packages.
[ ]'s
Chrome 33.0.1750 (Mac OS X 10.9.2) ERROR
Uncaught TypeError: undefined is not a function
at /Users/derp/Sites/derpaderp/public/lib/chai.js:765
//main.js:
requirejs.config({
paths: {
'chai' : 'chai'
, 'chai_change': 'chai-change'
}
, shim: {
, 'chai_change' : ['chai']
}
});
//file.js
define([
'chai'
, 'chai_change'
], function(chai){
//I know this should work because I'm also using chai-things, sinon-chai and chai-jq and they work fine.
chai.use(require('chai_change'));
});
Hi,
I'm new to ES6 dev and I don't know how to properly import chai-change to work together with chai.
Any ideas?
I can help adding this to Readme, as soon as I figure out how to do it myself. :)
What can chai-change do what chai-changes cannot?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.