From f67e121ed81d98239ba5b62f2de3d0f4de26806d Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 16:57:55 +0300 Subject: [PATCH] Test cleanup and fixes [g-h] --- test/gcd/gcd.test.js | 14 +++---- .../geometricProgression.test.js | 16 ++++---- test/get/get.test.js | 9 ++--- .../getColonTimeFromDate.test.js | 4 +- .../getDaysDiffBetweenDates.test.js | 8 ++-- .../getMeridiemSuffixOfInteger.test.js | 4 +- .../getScrollPosition.test.js | 6 +-- test/getStyle/getStyle.test.js | 6 +-- test/getType/getType.test.js | 8 ++-- .../getURLParameters/getURLParameters.test.js | 8 ++-- test/groupBy/groupBy.test.js | 14 +++---- test/hammingDistance/hammingDistance.test.js | 8 ++-- test/hasClass/hasClass.test.js | 6 +-- test/hasFlags/hasFlags.test.js | 6 +-- test/hashBrowser/hashBrowser.test.js | 6 +-- test/hashNode/hashNode.test.js | 9 ++--- test/head/head.test.js | 39 ++++++++++--------- test/hexToRGB/hexToRGB.test.js | 16 ++++---- test/hide/hide.test.js | 6 +-- test/howManyTimes/howManyTimes.test.js | 4 +- test/httpDelete/httpDelete.test.js | 4 +- test/httpGet/httpGet.test.js | 35 ++++++++--------- test/httpPost/httpPost.test.js | 31 +++++++-------- test/httpPut/httpPut.test.js | 4 +- test/httpsRedirect/httpsRedirect.test.js | 6 +-- test/hz/hz.test.js | 4 +- 26 files changed, 113 insertions(+), 168 deletions(-) diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js index f95f944a5..8657042d6 100644 --- a/test/gcd/gcd.test.js +++ b/test/gcd/gcd.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const gcd = require('./gcd.js'); - - test('gcd is a Function', () => { +test('gcd is a Function', () => { expect(gcd).toBeInstanceOf(Function); }); - test('Calculates the greatest common divisor between two or more numbers/arrays', () => { - expect(gcd(8, 36)).toBe(4) +test('Calculates the greatest common divisor between two or more numbers/arrays', () => { + expect(gcd(8, 36)).toBe(4); }); - test('Calculates the greatest common divisor between two or more numbers/arrays', () => { - expect(gcd(...[12, 8, 32])).toEqual(4) -}); - +test('Calculates the greatest common divisor between two or more numbers/arrays', () => { + expect(gcd(...[12, 8, 32])).toEqual(4); +}); diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js index 50fba67d1..c673143c1 100644 --- a/test/geometricProgression/geometricProgression.test.js +++ b/test/geometricProgression/geometricProgression.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const geometricProgression = require('./geometricProgression.js'); - - test('geometricProgression is a Function', () => { +test('geometricProgression is a Function', () => { expect(geometricProgression).toBeInstanceOf(Function); }); - test('Initializes an array containing the numbers in the specified range', () => { - expect(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128).toEqual(256]) +test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256)).toEqual([1, 2, 4, 8, 16, 32, 64, 128, 256]) }); - test('Initializes an array containing the numbers in the specified range', () => { - expect(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96).toEqual(192]) +test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256, 3)).toEqual([3, 6, 12, 24, 48, 96, 192]) }); - test('Initializes an array containing the numbers in the specified range', () => { - expect(geometricProgression(256, 1, 4), [1, 4, 16, 64).toEqual(256]) +test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256, 1, 4)).toEqual([1, 4, 16, 64, 256]) }); - diff --git a/test/get/get.test.js b/test/get/get.test.js index facab132c..526bb5bc6 100644 --- a/test/get/get.test.js +++ b/test/get/get.test.js @@ -1,13 +1,10 @@ const expect = require('expect'); const get = require('./get.js'); - - test('get is a Function', () => { +test('get is a Function', () => { expect(get).toBeInstanceOf(Function); }); - const obj = { selector: { to: { val: 'val to get' } } }; - test('Retrieve a property indicated by the selector from an object.', () => { +const obj = { selector: { to: { val: 'val to get' } } }; +test('Retrieve a property indicated by the selector from an object.', () => { expect(get(obj, 'selector.to.val')).toEqual(['val to get']) }); - - diff --git a/test/getColonTimeFromDate/getColonTimeFromDate.test.js b/test/getColonTimeFromDate/getColonTimeFromDate.test.js index 1f863ae33..e834ac265 100644 --- a/test/getColonTimeFromDate/getColonTimeFromDate.test.js +++ b/test/getColonTimeFromDate/getColonTimeFromDate.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const getColonTimeFromDate = require('./getColonTimeFromDate.js'); - - test('getColonTimeFromDate is a Function', () => { +test('getColonTimeFromDate is a Function', () => { expect(getColonTimeFromDate).toBeInstanceOf(Function); }); - diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js index 205eb4298..2128fe077 100644 --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); - - test('getDaysDiffBetweenDates is a Function', () => { +test('getDaysDiffBetweenDates is a Function', () => { expect(getDaysDiffBetweenDates).toBeInstanceOf(Function); }); - test('Returns the difference in days between two dates', () => { - expect(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22'))).toBe(9) +test('Returns the difference in days between two dates', () => { + expect(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22'))).toBe(9); }); - diff --git a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js index f18244388..936eb3c13 100644 --- a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js +++ b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const getMeridiemSuffixOfInteger = require('./getMeridiemSuffixOfInteger.js'); - - test('getMeridiemSuffixOfInteger is a Function', () => { +test('getMeridiemSuffixOfInteger is a Function', () => { expect(getMeridiemSuffixOfInteger).toBeInstanceOf(Function); }); - diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js index 7e9b12367..0137c4eb4 100644 --- a/test/getScrollPosition/getScrollPosition.test.js +++ b/test/getScrollPosition/getScrollPosition.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const getScrollPosition = require('./getScrollPosition.js'); - - test('getScrollPosition is a Function', () => { +test('getScrollPosition is a Function', () => { expect(getScrollPosition).toBeInstanceOf(Function); }); - - - diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js index 46fa01505..6f279ab81 100644 --- a/test/getStyle/getStyle.test.js +++ b/test/getStyle/getStyle.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const getStyle = require('./getStyle.js'); - - test('getStyle is a Function', () => { +test('getStyle is a Function', () => { expect(getStyle).toBeInstanceOf(Function); }); - - - diff --git a/test/getType/getType.test.js b/test/getType/getType.test.js index 68222a194..660a7f020 100644 --- a/test/getType/getType.test.js +++ b/test/getType/getType.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const getType = require('./getType.js'); - - test('getType is a Function', () => { +test('getType is a Function', () => { expect(getType).toBeInstanceOf(Function); }); - test('Returns the native type of a value', () => { - expect(getType(new Set([1, 2, 3]))).toBe('set') +test('Returns the native type of a value', () => { + expect(getType(new Set([1, 2, 3]))).toBe('set'); }); - diff --git a/test/getURLParameters/getURLParameters.test.js b/test/getURLParameters/getURLParameters.test.js index e9e75eaa1..3a63c7890 100644 --- a/test/getURLParameters/getURLParameters.test.js +++ b/test/getURLParameters/getURLParameters.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const getURLParameters = require('./getURLParameters.js'); - - test('getURLParameters is a Function', () => { +test('getURLParameters is a Function', () => { expect(getURLParameters).toBeInstanceOf(Function); }); - t.deepEqual(getURLParameters('http: - +test('Returns an object containing the parameters of the current URL', () => { + expect(getURLParameters(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({name: 'Adam', surname: 'Smith'}); +}); diff --git a/test/groupBy/groupBy.test.js b/test/groupBy/groupBy.test.js index 4e34675e5..7f1c61eae 100644 --- a/test/groupBy/groupBy.test.js +++ b/test/groupBy/groupBy.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const groupBy = require('./groupBy.js'); - - test('groupBy is a Function', () => { +test('groupBy is a Function', () => { expect(groupBy).toBeInstanceOf(Function); }); - test('Groups the elements of an array based on the given function', () => { - expect(groupBy([6.1, 4.2, 6.3], Math.floor), {4: [4.2], 6: [6.1).toEqual(6.3]}) +test('Groups the elements of an array based on the given function', () => { + expect(groupBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: [4.2], 6: [6.1, 6.3]}); }); - test('Groups the elements of an array based on the given function', () => { - expect(groupBy(['one', 'two', 'three'], 'length'), {3: ['one', 'two']).toEqual(5: ['three']}) -}); - +test('Groups the elements of an array based on the given function', () => { + expect(groupBy(['one', 'two', 'three'], 'length')).toEqual({3: ['one', 'two'], 5: ['three']}); +}); diff --git a/test/hammingDistance/hammingDistance.test.js b/test/hammingDistance/hammingDistance.test.js index 913a60018..b884b6c89 100644 --- a/test/hammingDistance/hammingDistance.test.js +++ b/test/hammingDistance/hammingDistance.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const hammingDistance = require('./hammingDistance.js'); - - test('hammingDistance is a Function', () => { +test('hammingDistance is a Function', () => { expect(hammingDistance).toBeInstanceOf(Function); }); - test('retuns hamming disance between 2 values', () => { - expect(hammingDistance(2, 3)).toBe(1) +test('retuns hamming disance between 2 values', () => { + expect(hammingDistance(2, 3)).toBe(1); }); - diff --git a/test/hasClass/hasClass.test.js b/test/hasClass/hasClass.test.js index 34ba77c26..74198e04e 100644 --- a/test/hasClass/hasClass.test.js +++ b/test/hasClass/hasClass.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const hasClass = require('./hasClass.js'); - - test('hasClass is a Function', () => { +test('hasClass is a Function', () => { expect(hasClass).toBeInstanceOf(Function); -}); - +}); diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js index 0278eed8e..b709e53f5 100644 --- a/test/hasFlags/hasFlags.test.js +++ b/test/hasFlags/hasFlags.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const hasFlags = require('./hasFlags.js'); - - test('hasFlags is a Function', () => { +test('hasFlags is a Function', () => { expect(hasFlags).toBeInstanceOf(Function); }); - - - diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js index f46f2f572..e51fe281c 100644 --- a/test/hashBrowser/hashBrowser.test.js +++ b/test/hashBrowser/hashBrowser.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const hashBrowser = require('./hashBrowser.js'); - - test('hashBrowser is a Function', () => { +test('hashBrowser is a Function', () => { expect(hashBrowser).toBeInstanceOf(Function); }); - - - diff --git a/test/hashNode/hashNode.test.js b/test/hashNode/hashNode.test.js index a66d989e0..250701418 100644 --- a/test/hashNode/hashNode.test.js +++ b/test/hashNode/hashNode.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const hashNode = require('./hashNode.js'); - - test('hashNode is a Function', () => { +test('hashNode is a Function', () => { expect(hashNode).toBeInstanceOf(Function); }); - hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => t.equal(v, '04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393', 'Produces the appropriate hash')); - - +test('Produces the appropriate hash', () => { + hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => expect(v).toBe('04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393')); +}); diff --git a/test/head/head.test.js b/test/head/head.test.js index f7644c2a5..01591d787 100644 --- a/test/head/head.test.js +++ b/test/head/head.test.js @@ -1,30 +1,33 @@ const expect = require('expect'); const head = require('./head.js'); - - test('head is a Function', () => { +test('head is a Function', () => { expect(head).toBeInstanceOf(Function); }); - test('head({ a: 1234}) returns undefined', () => { +test('head({ a: 1234}) returns undefined', () => { expect(head({ a: 1234}) === undefined).toBeTruthy(); }); - test('head([1, 2, 3]) returns 1', () => { - expect(head([1, 2, 3])).toBe(1) +test('head([1, 2, 3]) returns 1', () => { + expect(head([1, 2, 3])).toBe(1); }); - test('head({ 0: false}) returns false', () => { - expect(head({ 0: false}), false).toBe() +test('head({ 0: false}) returns false', () => { + expect(head({ 0: false})).toBeFalsy(); }); - test('head(String) returns S', () => { - expect(head('String'), 'S').toBe() +test('head(String) returns S', () => { + expect(head('String')).toBe('S'); }); - t.throws(() => head(null), 'head(null) throws an Error'); - t.throws(() => head(undefined), 'head(undefined) throws an Error'); - t.throws(() => head(), 'head() throws an Error'); - - let start = new Date().getTime(); - head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); - let end = new Date().getTime(); - test('head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { +test('head(null) throws an Error', () => { + expect(head(null)).toThrow(); +}); +test('head(undefined) throws an Error', () => { + expect(head(undefined)).toThrow(); +}); +test('head() throws an Error', () => { + expect(head()).toThrow(); +}); +let start = new Date().getTime(); +head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); +let end = new Date().getTime(); +test('head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - diff --git a/test/hexToRGB/hexToRGB.test.js b/test/hexToRGB/hexToRGB.test.js index d470a1803..2f2bf427e 100644 --- a/test/hexToRGB/hexToRGB.test.js +++ b/test/hexToRGB/hexToRGB.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const hexToRGB = require('./hexToRGB.js'); - - test('hexToRGB is a Function', () => { +test('hexToRGB is a Function', () => { expect(hexToRGB).toBeInstanceOf(Function); }); - test('Converts a color code to a rgb() or rgba() string', () => { - expect(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96).toBe(255)') +test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('#27ae60ff')).toBe('rgba(39, 174, 96, 255)'); }); - test('Converts a color code to a rgb() or rgba() string', () => { - expect(hexToRGB('27ae60'), 'rgb(39, 174).toBe(96)') +test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('27ae60')).toBe('rgb(39, 174, 96)'); }); - test('Converts a color code to a rgb() or rgba() string', () => { - expect(hexToRGB('#fff'), 'rgb(255, 255).toBe(255)') +test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('#fff')).toBe('rgb(255, 255, 255)'); }); - diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js index ae3a4e4a0..7cfa1ec53 100644 --- a/test/hide/hide.test.js +++ b/test/hide/hide.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const hide = require('./hide.js'); - - test('hide is a Function', () => { +test('hide is a Function', () => { expect(hide).toBeInstanceOf(Function); }); - - - diff --git a/test/howManyTimes/howManyTimes.test.js b/test/howManyTimes/howManyTimes.test.js index c5b17e44b..e0d7efe30 100644 --- a/test/howManyTimes/howManyTimes.test.js +++ b/test/howManyTimes/howManyTimes.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const howManyTimes = require('./howManyTimes.js'); - - test('howManyTimes is a Function', () => { +test('howManyTimes is a Function', () => { expect(howManyTimes).toBeInstanceOf(Function); }); - diff --git a/test/httpDelete/httpDelete.test.js b/test/httpDelete/httpDelete.test.js index fc67eb414..6603d33bd 100644 --- a/test/httpDelete/httpDelete.test.js +++ b/test/httpDelete/httpDelete.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const httpDelete = require('./httpDelete.js'); - - test('httpDelete is a Function', () => { +test('httpDelete is a Function', () => { expect(httpDelete).toBeInstanceOf(Function); }); - diff --git a/test/httpGet/httpGet.test.js b/test/httpGet/httpGet.test.js index 1270778c7..f5859ff68 100644 --- a/test/httpGet/httpGet.test.js +++ b/test/httpGet/httpGet.test.js @@ -7,21 +7,20 @@ const httpGet = (url, callback, err = console.error) => { request.send(); }; - - test('httpGet is a Function', () => { +test('httpGet is a Function', () => { expect(httpGet).toBeInstanceOf(Function); }); - httpGet('https: - t.deepEqual(JSON.parse(response), { - userId: 1, - id: 1, - title: - 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit', - body: - 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto', - }, 'Sends a GET request'); - - +test('Sends a GET request', () => { +httpGet('https://jsonplaceholder.typicode.com/posts/1', response => { + expect(JSON.parse(response)),toEqual({ + userId: 1, + id: 1, + title: + 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit', + body: + 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto', + }); +}); var Url = require("url"); var spawn = require("child_process").spawn; @@ -289,7 +288,7 @@ XMLHttpRequest = function() { self.responseText = data; setState(self.DONE); } - + } else { try { this.responseText = fs.readFileSync(url.pathname, "utf8"); @@ -377,18 +376,18 @@ XMLHttpRequest = function() { if (sendFlag) { setState(self.LOADING); } - + response.on("end", function() { if (sendFlag) { setState(self.DONE); sendFlag = false; } - + response.on("error", function(error) { self.handleError(error); - + }; var errorHandler = function errorHandler(error) { self.handleError(error); @@ -502,7 +501,7 @@ XMLHttpRequest = function() { if (event in listeners) { listeners[event] = listeners[event].filter(function(ev) { return ev !== callback; - + } }; diff --git a/test/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js index 62e65a49c..84dfe26ff 100644 --- a/test/httpPost/httpPost.test.js +++ b/test/httpPost/httpPost.test.js @@ -8,20 +8,19 @@ const httpPost = (url, data, callback, err = console.error) => { request.send(data); }; - test('httpPost is a Function', () => { +test('httpPost is a Function', () => { expect(httpPost).toBeInstanceOf(Function); }); - const data = { - title: 'foo', - body: 'bar', - userId: 1 - }; - httpPost('https: - test('Sends a POST request', () => { - expect(JSON.parse(response).id, 101).toEqual() +const data = { + title: 'foo', + body: 'bar', + userId: 1 +}; +test('Sends a POST request', () => { + httpPost('https://jsonplaceholder.typicode.com/posts', JSON.stringify(data), response => { + expect(JSON.parse(response).id).toEqual(101); + }); }); - - var Url = require("url"); var spawn = require("child_process").spawn; @@ -289,7 +288,7 @@ XMLHttpRequest = function() { self.responseText = data; setState(self.DONE); } - + } else { try { this.responseText = fs.readFileSync(url.pathname, "utf8"); @@ -377,18 +376,18 @@ XMLHttpRequest = function() { if (sendFlag) { setState(self.LOADING); } - + response.on("end", function() { if (sendFlag) { setState(self.DONE); sendFlag = false; } - + response.on("error", function(error) { self.handleError(error); - + }; var errorHandler = function errorHandler(error) { self.handleError(error); @@ -502,7 +501,7 @@ XMLHttpRequest = function() { if (event in listeners) { listeners[event] = listeners[event].filter(function(ev) { return ev !== callback; - + } }; diff --git a/test/httpPut/httpPut.test.js b/test/httpPut/httpPut.test.js index a9beac9db..d76892baf 100644 --- a/test/httpPut/httpPut.test.js +++ b/test/httpPut/httpPut.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const httpPut = require('./httpPut.js'); - - test('httpPut is a Function', () => { +test('httpPut is a Function', () => { expect(httpPut).toBeInstanceOf(Function); }); - diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js index 6727278bc..68dd20f32 100644 --- a/test/httpsRedirect/httpsRedirect.test.js +++ b/test/httpsRedirect/httpsRedirect.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const httpsRedirect = require('./httpsRedirect.js'); - - test('httpsRedirect is a Function', () => { +test('httpsRedirect is a Function', () => { expect(httpsRedirect).toBeInstanceOf(Function); }); - - - diff --git a/test/hz/hz.test.js b/test/hz/hz.test.js index a9ae095f1..58d0b4678 100644 --- a/test/hz/hz.test.js +++ b/test/hz/hz.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const hz = require('./hz.js'); - - test('hz is a Function', () => { +test('hz is a Function', () => { expect(hz).toBeInstanceOf(Function); }); -