Skip to content

Commit

Permalink
add simple infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
erykpiast committed May 6, 2015
1 parent 4f8cb0a commit 90dadd1
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 9 deletions.
73 changes: 73 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"esnext": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireOperatorBeforeLineBreak": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"maximumLineLength": {
"value": 90,
"allowComments": true,
"allowRegex": true
},
"validateIndentation": 4,
"validateQuoteMarks": "'",

"disallowMultipleLineStrings": true,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowMultipleVarDecl": true,

"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpacesInConditionalExpression": true,
"requireLineFeedAtFileEnd": true,
"disallowSpacesInsideObjectBrackets": "all",
"disallowSpacesInsideArrayBrackets": "all",
"disallowSpacesInsideParentheses": true,

"disallowMultipleLineBreaks": true,

"requireParenthesesAroundIIFE": true,

"disallowKeywords": ["with"],

"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},

"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},

"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},

"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},

"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
}
}
43 changes: 43 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"globals": { },
"node": true,
"regexdash": true,
"browser": true,
"sub": true,
"curly": true,
"camelcase": true,
"eqeqeq": true,
"forin": true,
"newcap": true,
"immed": true,
"indent": false,
"latedef": "nofunc",
"noarg": true,
"plusplus": false,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": false,
"trailing": false,
"maxparams": false,
"maxdepth": false,
"maxstatements": false,
"maxcomplexity": false,
"maxlen": 200,
"asi": false,
"boss": false,
"debug": true,
"eqnull": false,
"esnext": false,
"evil": false,
"funcscope": false,
"smarttabs": false,
"shadow": true,
"supernew": true,
"devel": true,
"node": true,
"white": false,
"laxbreak": true,
"validthis": true,
"esnext": true
}
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore/
.idea/
*.sublime-project
*.sublime-workspace
17 changes: 17 additions & 0 deletions dist/chai-spies-tdd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});

exports['default'] = function (chai, utils) {
utils.addMethod(chai.assert, 'calledOnce', function (actual, expected, msg) {
new chai.Assertion(actual).to.have.been.called.once(msg);
});

utils.addMethod(chai.assert, 'notCalledOnce', function (actual, expected, msg) {
new chai.Assertion(actual).not.to.have.been.called.once(msg);
});
};

module.exports = exports['default'];
9 changes: 0 additions & 9 deletions index.js

This file was deleted.

41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "chai-spies-tdd",
"version": "0.0.0",
"author": "Eryk Napierala",
"description": "TDD-style interface for chai-spies.",
"license": "MIT",
"homepage": "https://github.com/erykpiast/chai-spies-tdd",
"bugs": "https://github.com/erykpiast/chai-spies-tdd/issues",
"repository": {
"type": "git",
"url": "https://github.com/erykpiast/chai-spies-tdd"
},
"keywords": [
"cyclejs",
"streams",
"group"
],
"main": "dist/chai-spies-tdd.js",
"peerDependencies": {
"chai-spies": ">=0.6"
},
"devDependencies": {
"babel": "~5.2",
"jscs": "~1.12",
"jshint": "~2.7"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"jshint": "jshint src/",
"jscs": "jscs src/",
"precompile": "rm -rf dist/ && mkdir -p dist",
"compile": "babel -d dist/ src/",
"prepublish": "npm run compile",
"release": "npm run release-patch",
"release-patch": "git checkout master && npm run compile; git commit -a -m 'Build dist/'; npm version patch && git push origin master --tags && npm publish",
"release-minor": "git checkout master && npm run compile; git commit -a -m 'Build dist/'; npm version minor && git push origin master --tags && npm publish",
"release-major": "git checkout master && npm run compile; git commit -a -m 'Build dist/'; npm version major && git push origin master --tags && npm publish"
}
}
9 changes: 9 additions & 0 deletions src/chai-spies-tdd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function (chai, utils) {
utils.addMethod(chai.assert, 'calledOnce', function (actual, expected, msg) {
new chai.Assertion(actual).to.have.been.called.once(msg);
});

utils.addMethod(chai.assert, 'notCalledOnce', function (actual, expected, msg) {
new chai.Assertion(actual).not.to.have.been.called.once(msg);
});
}

0 comments on commit 90dadd1

Please sign in to comment.