diff --git a/test/smoothScroll/smoothScroll.js b/test/smoothScroll/smoothScroll.js new file mode 100644 index 000000000..6d4ff2a1c --- /dev/null +++ b/test/smoothScroll/smoothScroll.js @@ -0,0 +1,5 @@ +const smoothScroll = element => +document.querySelector(element).scrollIntoView({ +behavior: 'smooth' +}); +module.exports = smoothScroll; \ No newline at end of file diff --git a/test/smoothScroll/smoothScroll.test.js b/test/smoothScroll/smoothScroll.test.js new file mode 100644 index 000000000..e74581e2c --- /dev/null +++ b/test/smoothScroll/smoothScroll.test.js @@ -0,0 +1,13 @@ +const test = require('tape'); +const smoothScroll = require('./smoothScroll.js'); + +test('Testing smoothScroll', (t) => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + t.true(typeof smoothScroll === 'function', 'smoothScroll is a Function'); + //t.deepEqual(smoothScroll(args..), 'Expected'); + //t.equal(smoothScroll(args..), 'Expected'); + //t.false(smoothScroll(args..), 'Expected'); + //t.throws(smoothScroll(args..), 'Expected'); + t.end(); +}); \ No newline at end of file diff --git a/test/testlog b/test/testlog index b8df610f2..de15818cb 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Fri Mar 02 2018 20:31:49 GMT+0000 (UTC) +Test log for: Sat Mar 03 2018 20:31:08 GMT+0000 (UTC) > 30-seconds-of-code@0.0.2 test /home/travis/build/Chalarangelo/30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -1532,6 +1532,10 @@ Test log for: Fri Mar 02 2018 20:31:49 GMT+0000 (UTC) ✔ sleep is a Function + Testing smoothScroll + + ✔ smoothScroll is a Function + Testing solveRPN ✔ solveRPN is a Function @@ -1952,8 +1956,8 @@ Test log for: Fri Mar 02 2018 20:31:49 GMT+0000 (UTC) ✔ zipWith is a Function ✔ Sends a GET request - ✔ Sends a POST request ✔ Runs the function provided + ✔ Sends a POST request ✔ Runs promises in series ✔ Works as expecting, passing arguments properly ✔ Works with multiple promises @@ -1968,8 +1972,8 @@ Test log for: Fri Mar 02 2018 20:31:49 GMT+0000 (UTC) ✖ length of string is 8 - total: 987 - passing: 985 + total: 988 + passing: 986 failing: 2 duration: 2.5s