refact: removed cli progressbar from tests
This commit is contained in:
parent
3944e4288a
commit
07cb1e3fe5
@ -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",
|
||||
|
@ -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',
|
||||
|
@ -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 = [
|
||||
|
@ -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({
|
||||
|
@ -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 = [
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Table from '../../core/entities/Table.js'
|
||||
import Table from '../../src/entities/Table.js'
|
||||
|
||||
const input = {
|
||||
id: 'abc',
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user