Permalink
Browse files

Update for Chai v4

  • Loading branch information...
meeber authored and joshperry committed Dec 18, 2016
1 parent 0b1ffc5 commit 4378c7a6232f5125723b2da5e41b4483ccb6f2aa
Showing with 22 additions and 17 deletions.
  1. +2 −1 .travis.yml
  2. +3 −2 Gruntfile.js
  3. +12 −11 package.json
  4. +5 −3 test/dirty-chai.spec.js
View
@@ -1,6 +1,7 @@
language: node_js
node_js:
- "0.10"
- "4"
- "6"
before_install:
npm install -g grunt-cli
script:
View
@@ -14,7 +14,8 @@ module.exports = function (grunt) {
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
reporter: require('jshint-stylish'),
reporterOutput: ''
},
all: '{lib,test}/**/*.js'
},
@@ -31,5 +32,5 @@ module.exports = function (grunt) {
grunt.registerTask('dev', ['watch']);
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('ci', ['jshint', 'mochaTest']);
grunt.registerTask('ci', ['jshint:all', 'mochaTest']);
};
View
@@ -23,20 +23,21 @@
},
"homepage": "https://github.com/prodatakey/dirty-chai",
"devDependencies": {
"chai": "<1.10.0 || >1.10.0 <4",
"chai-as-promised": ">4.2.0 <6",
"es6-promise": "^2.0.1",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-mocha-test": "^0.12.2",
"jshint": "^2.5.10",
"jshint-stylish": "^1.0.0",
"load-grunt-tasks": "^1.0.0",
"chai": "^4.0.0",
"chai-as-promised": "^7.0.0",
"es6-promise": "^4.0.0",
"grunt": "^1.0.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-mocha-test": "^0.13.0",
"jshint": "^2.9.0",
"jshint-stylish": "^2.0.0",
"load-grunt-tasks": "^3.0.0",
"mocha": "^3.4.2",
"require-uncached": "^1.0.2"
},
"peerDependencies": {
"chai": "<1.10.0 || >1.10.0 <4"
"chai": ">=2.2.1 <5"
},
"dependencies": {}
}
View
@@ -43,7 +43,9 @@ describe('dirty chai', function() {
describe('when false expression', function() {
it('should assert non-function at chain end', function() {
var assertion = expect(true).to.not.be.ok.and.not;
shouldFail(assertion.equal.bind(assertion, false), /expected true to be falsy/);
shouldFail(function () {
assertion.equal.call(assertion, false);
}, /expected true to be falsy/);
});
it('should assert with custom message at chain end', function() {
@@ -124,9 +126,9 @@ describe('dirty chai', function() {
it('should convert property to a chainable method', function() {
var prop = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, 'neverFail');
chai.Assertion.prototype.should.have.a.property('neverFail').and.should.be.a('function');
(new chai.Assertion({})).should.have.a.property('neverFail').and.be.a('function');
prop.should.have.property('get').and.be.a('function');
prop.get.call(new chai.Assertion({})).should.be.a('function');
((new chai.Assertion({}).neverFail)).should.be.a('function');
});
it('should call assertion', function() {

0 comments on commit 4378c7a

Please sign in to comment.