add type test, error test, omit test to words
This commit is contained in:
@ -5,12 +5,15 @@ 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('I love javaScript!!'), ["I", "love", "javaScript"], "words('I love javaScript!!') returns [I, love, javaScript]");
|
||||
t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "words('python, javaScript & coffee') returns [python, javaScript, coffee]");
|
||||
t.true(Array.isArray(words('I love javaScript!!')), 'words(I love javaScript!!) returns an array');
|
||||
t.throws(() => words(), 'words() throws a error');
|
||||
t.throws(() => words(null), 'words(null) throws a error');
|
||||
t.throws(() => words(undefined), 'words(undefined) throws a error');
|
||||
t.throws(() => words({}), 'words({}) throws a error');
|
||||
t.throws(() => words([]), 'words([]) throws a error');
|
||||
t.throws(() => words(1234), 'words(1234) throws a error');
|
||||
|
||||
//t.deepEqual(words(args..), 'Expected');
|
||||
//t.equal(words(args..), 'Expected');
|
||||
//t.false(words(args..), 'Expected');
|
||||
//t.throws(words(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user