Comparing version 0.1.0 to 0.1.1
17
index.js
module.exports = function chaiLint(chai, utils) { | ||
var methods = [ | ||
var standardMethods = [ | ||
'ok', | ||
@@ -12,9 +12,18 @@ 'true', | ||
addMethods(methods); | ||
var sinonMethods = [ | ||
'called', | ||
'calledOnce', | ||
'calledTwice', | ||
'calledThrice', | ||
'calledWithNew', | ||
]; | ||
addMethods(standardMethods, 'be'); | ||
addMethods(sinonMethods, 'been'); | ||
addMethod('exist', 'toExist'); | ||
function addMethods(methods) { | ||
function addMethods(methods, prefix) { | ||
for (var i = methods.length - 1; i >= 0; i--) { | ||
var property = methods[i]; | ||
var name = 'be' + property[0].toUpperCase() + property.slice(1); | ||
var name = prefix + property[0].toUpperCase() + property.slice(1); | ||
addMethod(methods[i], name); | ||
@@ -21,0 +30,0 @@ } |
{ | ||
"name": "chai-lint", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Chai plugin which plays nice with linters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,1 +22,9 @@ Allows to bypass [chai](https://github.com/chaijs/chai)'s property assertions, which make linters unhappy (confer https://github.com/eslint/eslint/issues/2102). | ||
``` | ||
Sinon assertions are also supported, for example: | ||
``` | ||
expect(spy).to.have.beenCalled(); | ||
``` | ||
3087
34
30