console-nice
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "console-nice", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
## console.nice('sweet!') | ||
![](logo.png) | ||
@@ -10,2 +10,3 @@ `console.nice` is a development utility. It's almost identical to `console.log` but instead of returning `undefined`, it returns the value passed into it (+ logging it). | ||
var konsole = require('./index.js')(console) | ||
var assert = require('assert') | ||
var n = konsole.nice | ||
@@ -21,4 +22,8 @@ | ||
var results = n(add(n(remove(10, 5), '10 - 5'), n(remove(10, 7), '10 - 7')), '(10 - 5) + (10 - 7)') | ||
n(results, 'results') | ||
var results = add( | ||
n(remove(10, 5), '10 - 5'), | ||
n(remove(10, 7), '10 - 7') | ||
) | ||
n(results, '(10 - 5) + (10 - 7)') | ||
``` | ||
@@ -31,3 +36,2 @@ | ||
(10 - 5) + (10 - 7) = 8 | ||
results = 8 | ||
``` | ||
@@ -45,3 +49,1 @@ | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
21
test.js
var konsole = require('./index.js')(console) | ||
var assert = require('assert') | ||
var n = konsole.nice | ||
@@ -12,3 +13,19 @@ | ||
var results = n(add(n(remove(10, 5), '10 - 5'), n(remove(10, 7), '10 - 7')), '(10 - 5) + (10 - 7)') | ||
n(results, 'results') | ||
console.log('Test Output:') | ||
var results = add( | ||
n(remove(10, 5), '10 - 5'), | ||
n(remove(10, 7), '10 - 7') | ||
) | ||
n(results, '(10 - 5) + (10 - 7)') | ||
console.log('</Test Output>\n\n') | ||
console.log('Unit tests:') | ||
var adding_results = n(add(1, 1), '1 + 1') | ||
assert.strictEqual(adding_results, 2) | ||
assert.strictEqual(results, 8) | ||
var creating_object = n({}, '{}') | ||
assert.deepEqual(creating_object, {}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26920
5
36
46