-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Emilio
authored and
Emilio
committed
May 13, 2016
1 parent
9e993f0
commit 27fccc9
Showing
10 changed files
with
223 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,7 @@ node_modules | |
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Local configs | ||
local-* | ||
*-local.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: node_js | ||
node_js: | ||
- "0.12.7" | ||
- "4" | ||
- "6" | ||
matrix: | ||
fast_finish: true | ||
allow_failures: | ||
- node_js: "6" | ||
script: "npm run-script test-ci" | ||
after_script: "npm install coveralls@2.11.8 && cat ./coverage/lcov.info | coveralls" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!--multilang v0 es:LEEME.md en:README.md --> | ||
# discrepances | ||
show discrepances in several flavors | ||
|
||
<!--lang:es--> | ||
# Instalación | ||
<!--lang:en--] | ||
# Install | ||
[!--lang:*--> | ||
```sh | ||
$ npm install discrepances | ||
``` | ||
|
||
<!-- cucardas --> | ||
![designing](https://img.shields.io/badge/stability-designing-red.svg) | ||
[![npm-version](https://img.shields.io/npm/v/discrepances.svg)](https://npmjs.org/package/discrepances) | ||
[![downloads](https://img.shields.io/npm/dm/discrepances.svg)](https://npmjs.org/package/discrepances) | ||
[![build](https://img.shields.io/travis/codenautas/discrepances/master.svg)](https://travis-ci.org/codenautas/discrepances) | ||
[![coverage](https://img.shields.io/coveralls/codenautas/discrepances/master.svg)](https://coveralls.io/r/codenautas/discrepances) | ||
[![climate](https://img.shields.io/codeclimate/github/codenautas/discrepances.svg)](https://codeclimate.com/github/codenautas/discrepances) | ||
[![dependencies](https://img.shields.io/david/codenautas/discrepances.svg)](https://david-dm.org/codenautas/discrepances) | ||
[![qa-control](http://codenautas.com/github/codenautas/discrepances.svg)](http://codenautas.com/github/codenautas/discrepances) | ||
|
||
|
||
<!--multilang buttons--> | ||
|
||
idioma: ![castellano](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png) | ||
también disponible en: | ||
[![inglés](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)](README.md) | ||
|
||
<!--lang:es--> | ||
## Licencia | ||
<!--lang:en--] | ||
## License | ||
[!--lang:*--> | ||
|
||
[MIT](LICENSE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# discrepances | ||
show discrepances in several flavors | ||
|
||
# Install | ||
```sh | ||
$ npm install discrepances | ||
``` | ||
|
||
![designing](https://img.shields.io/badge/stability-designing-red.svg) | ||
[![npm-version](https://img.shields.io/npm/v/discrepances.svg)](https://npmjs.org/package/discrepances) | ||
[![downloads](https://img.shields.io/npm/dm/discrepances.svg)](https://npmjs.org/package/discrepances) | ||
[![build](https://img.shields.io/travis/codenautas/discrepances/master.svg)](https://travis-ci.org/codenautas/discrepances) | ||
[![coverage](https://img.shields.io/coveralls/codenautas/discrepances/master.svg)](https://coveralls.io/r/codenautas/discrepances) | ||
[![climate](https://img.shields.io/codeclimate/github/codenautas/discrepances.svg)](https://codeclimate.com/github/codenautas/discrepances) | ||
[![dependencies](https://img.shields.io/david/codenautas/discrepances.svg)](https://david-dm.org/codenautas/discrepances) | ||
[![qa-control](http://codenautas.com/github/codenautas/discrepances.svg)](http://codenautas.com/github/codenautas/discrepances) | ||
|
||
|
||
|
||
language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png) | ||
also available in: | ||
[![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](LEEME.md) | ||
|
||
## License | ||
|
||
[MIT](LICENSE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
environment: | ||
matrix: | ||
- nodejs_version: "0.12.7" | ||
- nodejs_version: "4" | ||
- nodejs_version: "6" | ||
matrix: | ||
fast_finish: true | ||
install: | ||
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) | ||
- npm install | ||
build: off | ||
test_script: | ||
- node --version | ||
- npm --version | ||
- npm run test-ci | ||
version: "{build}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
/*jshint eqnull:true */ | ||
/*jshint globalstrict:true */ | ||
/*jshint node:true */ | ||
/*eslint-disable no-console */ | ||
|
||
var Discrepances = {}; | ||
|
||
module.exports = Discrepances; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use strict"; | ||
/*jshint eqnull:true */ | ||
/*jshint node:true */ | ||
|
||
(function codenautasModuleDefinition(root, name, factory) { | ||
/* global define */ | ||
/* istanbul ignore next */ | ||
if(typeof root.globalModuleName !== 'string'){ | ||
root.globalModuleName = name; | ||
} | ||
/* istanbul ignore next */ | ||
if(typeof exports === 'object' && typeof module === 'object'){ | ||
module.exports = factory(); | ||
}else if(typeof define === 'function' && define.amd){ | ||
define(factory); | ||
}else if(typeof exports === 'object'){ | ||
exports[root.globalModuleName] = factory(); | ||
}else{ | ||
root[root.globalModuleName] = factory(); | ||
} | ||
root.globalModuleName = null; | ||
})(/*jshint -W040 */this, 'discrepances', function() { | ||
/*jshint +W040 */ | ||
|
||
/*jshint -W004 */ | ||
var discrepances = {}; | ||
/*jshint +W004 */ | ||
|
||
discrepances = function discrepances(obj, def){ | ||
var rta=''; | ||
if(def.typeof && typeof obj !== def.typeof){ | ||
rta+='typeof '+JSON.stringify(obj)+' !== '+JSON.stringify(def.typeof); | ||
} | ||
return rta || null; | ||
} | ||
|
||
return discrepances; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"name": "discrepances", | ||
"description": "show discrepances in several flavors", | ||
"version": "0.0.1", | ||
"author": "Codenautas <codenautas@googlegroups.com>", | ||
"repository": "codenautas/discrepances", | ||
"license": "MIT", | ||
"contributors": [ | ||
{ | ||
"name": "Emilio Platzer", | ||
"email": "emilioplatzer@gmail.com" | ||
} | ||
], | ||
"main": "lib/discrepances.js", | ||
"files": ["lib"], | ||
"dependencies": { | ||
"fs-extra": "~0.30.0", | ||
"fs-promise": "~0.5.0", | ||
|
||
"best-promise": "~0.2.4" | ||
}, | ||
"devDependencies": { | ||
"expect.js": "~0.3.1", | ||
"istanbul": "~0.4.3", | ||
"mocha": "~2.4.5", | ||
|
||
"best-globals": "~0.2.4", | ||
"self-explain": "~0.0.6" | ||
}, | ||
"engines": { | ||
"node": ">= 0.12" | ||
}, | ||
"scripts": { | ||
"test": "mocha --reporter spec --bail --check-leaks test/", | ||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", | ||
"start": "node example/server.js" | ||
}, | ||
"jshintConfig": { | ||
"asi": false, | ||
"forin": true, | ||
"curly": true | ||
|
||
}, | ||
"eslintConfig": { | ||
"env": { | ||
"node": false | ||
}, | ||
"rules": { | ||
"strict": 0, | ||
"no-console": 1, | ||
"no-unused-vars": 1 | ||
} | ||
}, | ||
"qa-control": { | ||
"package-version": "0.2.0", | ||
"coverage": 90, | ||
"run-in": "both", | ||
"stability": "extending", | ||
"type": "lib" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use strict"; | ||
|
||
var assert = require('self-explain').assert; | ||
var expect = require('expect.js'); | ||
var discrepances = require('../lib/discrepances.js'); | ||
|
||
describe("discrepances", function(){ | ||
[ | ||
{obj:4 , structure:{typeof: "number"}, expect: null}, | ||
{obj:"4", structure:{typeof: "number"}, expect: 'typeof "4" !== "number"'} | ||
].forEach(function(fixture){ | ||
it("controls discrepances via fixture: "+JSON.stringify(fixture), function(){ | ||
eval(assert(discrepances(fixture.obj, fixture.structure) === fixture.expect)); | ||
expect(discrepances(fixture.obj, fixture.structure)).to.eql(fixture.expect); | ||
}); | ||
}); | ||
}); |