Skip to content

Commit

Permalink
Simplify test output
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 5, 2016
1 parent 083123a commit e330d55
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module cuss
* @fileoverview Test suite for `cuss`.
*/

'use strict';

/* Dependencies. */
var assert = require('assert');
var test = require('tape');
var profanities = require('profanities');
var fck = require('f-ck');
Expand All @@ -33,25 +26,20 @@ test('cuss', function (t) {

test('profanities', function (t) {
profanities.forEach(function (profanity) {
t.test(fck(profanity), function (st) {
st.plan(4);

t.doesNotThrow(function () {
if (!(profanity in cuss)) {
missing.push(profanity);
}

st.ok(profanity in cuss, 'should exist');
st.equal(typeof cuss[profanity], 'number', 'should be a number');
st.ok(cuss[profanity] >= 0, 'should be gte 0');
st.ok(cuss[profanity] <= 2, 'should be lte 2');
});
assert.ok(profanity in cuss, 'should exist');
assert.equal(typeof cuss[profanity], 'number', 'should be a number');
assert.ok(cuss[profanity] >= 0, 'should be gte 0');
assert.ok(cuss[profanity] <= 2, 'should be lte 2');
}, fck(profanity));
});

t.test(function (st) {
st.equal(Object.keys(cuss).length, 1751, 'should have a count');
st.deepEqual(missing, [], 'should not have missing profanities');
st.end();
});
t.equal(Object.keys(cuss).length, 1751, 'should have a count');
t.deepEqual(missing, [], 'should not have missing profanities');

t.end();
});

0 comments on commit e330d55

Please sign in to comment.