From 07cb1e3fe599b576809573ed3b1cdb89d605dbaa Mon Sep 17 00:00:00 2001 From: Joshua Shoemaker Date: Wed, 24 Jun 2020 11:25:52 -0500 Subject: [PATCH] refact: removed cli progressbar from tests --- package.json | 3 +-- tests/core/NoduleTests.js | 4 ++-- tests/core/nodules/filterNoduleTests.js | 4 ++-- tests/core/nodules/joinNoduleTests.js | 4 ++-- tests/core/nodules/transformNoduleTests.js | 4 ++-- tests/core/tableTests.js | 2 +- tests/index.js | 17 ++++------------- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index da7ca21..2a0950a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dmein", - "version": "0.1.2", + "version": "0.1.3", "description": "Dmein is a modern JavaScript Library to create objects that easily mutate data through relationships, filtering, and tranforming the shape of data.", "main": "index.js", "directories": { @@ -21,7 +21,6 @@ }, "homepage": "https://github.com/joshuashoemaker/dmein#readme", "devDependencies": { - "progress": "^2.0.3", "@babel/core": "^7.10.3", "@babel/plugin-proposal-class-properties": "^7.10.1", "@babel/preset-env": "^7.10.3", diff --git a/tests/core/NoduleTests.js b/tests/core/NoduleTests.js index 75d28ee..0071e2c 100644 --- a/tests/core/NoduleTests.js +++ b/tests/core/NoduleTests.js @@ -1,5 +1,5 @@ -import Nodule from '../../core/entities/Nodule.js' -import Table from '../../core/entities/Table.js' +import Nodule from '../../src/entities/Nodule.js' +import Table from '../../src/entities/Table.js' const input = { id: 'ABC', diff --git a/tests/core/nodules/filterNoduleTests.js b/tests/core/nodules/filterNoduleTests.js index 05b9b19..1faad8d 100644 --- a/tests/core/nodules/filterNoduleTests.js +++ b/tests/core/nodules/filterNoduleTests.js @@ -1,5 +1,5 @@ -import FilterNodule from '../../../core/entities/nodules/FilterNodule.js' -import Table from '../../../core/entities/Table.js' +import FilterNodule from '../../../src/entities/nodules/FilterNodule.js' +import Table from '../../../src/entities/Table.js' const equalFilter = () => { const expectedOutput = [ diff --git a/tests/core/nodules/joinNoduleTests.js b/tests/core/nodules/joinNoduleTests.js index 1eea495..4be5e7c 100644 --- a/tests/core/nodules/joinNoduleTests.js +++ b/tests/core/nodules/joinNoduleTests.js @@ -1,5 +1,5 @@ -import JoinNodule from '../../../core/entities/nodules/JoinNodule.js' -import Table from '../../../core/entities/Table.js' +import JoinNodule from '../../../src/entities/nodules/JoinNodule.js' +import Table from '../../../src/entities/Table.js' const joinTables = () => { const pickupTable = new Table({ diff --git a/tests/core/nodules/transformNoduleTests.js b/tests/core/nodules/transformNoduleTests.js index 6d6b810..e8723a8 100644 --- a/tests/core/nodules/transformNoduleTests.js +++ b/tests/core/nodules/transformNoduleTests.js @@ -1,5 +1,5 @@ -import Table from '../../../core/entities/Table.js' -import TransformNodule from '../../../core/entities/nodules/TransformNodule.js' +import Table from '../../../src/entities/Table.js' +import TransformNodule from '../../../src/entities/nodules/TransformNodule.js' const transformTable = () => { const expectedOutput = [ diff --git a/tests/core/tableTests.js b/tests/core/tableTests.js index 6874936..9c5a984 100644 --- a/tests/core/tableTests.js +++ b/tests/core/tableTests.js @@ -1,4 +1,4 @@ -import Table from '../../core/entities/Table.js' +import Table from '../../src/entities/Table.js' const input = { id: 'abc', diff --git a/tests/index.js b/tests/index.js index a4d0980..a922ba3 100644 --- a/tests/index.js +++ b/tests/index.js @@ -1,29 +1,20 @@ -import ProgressBar from 'progress' +// import ProgressBar from 'progress' import tableTests from '../tests/core/tableTests.js' -import noduleTests from '../tests/core/noduleTests.js' +import noduleTests from '../tests/core/NoduleTests.js' import filterNoduleTests from '../tests/core/nodules/filterNoduleTests.js' import joinNoduleTests from '../tests/core/nodules/joinNoduleTests.js' import transformNoduleTests from '../tests/core/nodules/transformNoduleTests.js' function runTestsAndReturnFailures (tests) { const testTotalCount = tests.length - - const testBar = new ProgressBar( - `\x1b[36mRunning Tests [:bar] :current/${testTotalCount}`, - { total: testTotalCount } - ) - - let testsFailed = [] + const testsFailed = [] for (let i = 0; i < testTotalCount; i++) { const passedTest = tests[i].test() - testBar.tick() - if (!passedTest) testsFailed.push(tests[i].name) - - if (testBar.complete) return testsFailed } + return testsFailed } function init (tests) {