Files
30-seconds-of-code/test/words/words.test.js
Stefan Feješ 09fe99d66d update words test,
My bad I didn't use deepEqual when comparing ...
2018-01-10 11:47:47 +01:00

16 lines
668 B
JavaScript

const test = require('tape');
const words = require('./words.js');
test('Testing words', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof words === 'function', 'words is a Function');
t.deepEqual(words('I love javaScript!!'), ["I", "love", "javaScript"], "Returns words from a string");
t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "Returns words from a string");
//t.deepEqual(words(args..), 'Expected');
//t.equal(words(args..), 'Expected');
//t.false(words(args..), 'Expected');
//t.throws(words(args..), 'Expected');
t.end();
});