diff --git a/test/arrayToHtmlList/arrayToHtmlList.js b/test/arrayToHtmlList/arrayToHtmlList.js new file mode 100644 index 000000000..ae6fed9c2 --- /dev/null +++ b/test/arrayToHtmlList/arrayToHtmlList.js @@ -0,0 +1,3 @@ +const arrayToHtmlList = (arr, listID) => +arr.map(item => (document.querySelector('#' + listID).innerHTML += `
  • ${item}
  • `)); +module.exports = arrayToHtmlList \ No newline at end of file diff --git a/test/arrayToHtmlList/arrayToHtmlList.test.js b/test/arrayToHtmlList/arrayToHtmlList.test.js new file mode 100644 index 000000000..1f8885778 --- /dev/null +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const arrayToHtmlList = require('./arrayToHtmlList.js'); + +test('Testing arrayToHtmlList', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function'); + //t.deepEqual(arrayToHtmlList(args..), 'Expected'); + //t.equal(arrayToHtmlList(args..), 'Expected'); + //t.false(arrayToHtmlList(args..), 'Expected'); + //t.throws(arrayToHtmlList(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/hasClass/hasClass.js b/test/hasClass/hasClass.js new file mode 100644 index 000000000..c14590500 --- /dev/null +++ b/test/hasClass/hasClass.js @@ -0,0 +1,2 @@ +const hasClass = (el, className) => el.classList.contains(className); +module.exports = hasClass \ No newline at end of file diff --git a/test/hasClass/hasClass.test.js b/test/hasClass/hasClass.test.js new file mode 100644 index 000000000..43932ea01 --- /dev/null +++ b/test/hasClass/hasClass.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const hasClass = require('./hasClass.js'); + +test('Testing hasClass', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof hasClass === 'function', 'hasClass is a Function'); + //t.deepEqual(hasClass(args..), 'Expected'); + //t.equal(hasClass(args..), 'Expected'); + //t.false(hasClass(args..), 'Expected'); + //t.throws(hasClass(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index 9843777a4..259d8d6f6 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sat Jan 27 2018 11:05:08 GMT-0500 (Eastern Standard Time) +Test log for: Sun Jan 28 2018 14:42:53 GMT-0500 (Eastern Standard Time) > 30-seconds-of-code@0.0.1 test C:\Users\King David\Desktop\github-repo\30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -9,6 +9,10 @@ Test log for: Sat Jan 27 2018 11:05:08 GMT-0500 (Eastern Standard Time) √ anagrams is a Function √ Generates all anagrams of a string + Testing arrayToHtmlList + + √ arrayToHtmlList is a Function + Testing ary √ ary is a Function @@ -453,6 +457,10 @@ Test log for: Sat Jan 27 2018 11:05:08 GMT-0500 (Eastern Standard Time) √ hammingDistance is a Function √ retuns hamming disance between 2 values + Testing hasClass + + √ hasClass is a Function + Testing hasFlags √ hasFlags is a Function @@ -1513,8 +1521,8 @@ Test log for: Sat Jan 27 2018 11:05:08 GMT-0500 (Eastern Standard Time) √ zipWith is a Function - total: 647 - passing: 647 - duration: 576ms + total: 649 + passing: 649 + duration: 499ms