refact: removed cli progressbar from tests
This commit is contained in:
		
							parent
							
								
									3944e4288a
								
							
						
					
					
						commit
						07cb1e3fe5
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "dmein",
 | 
					  "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.",
 | 
					  "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",
 | 
					  "main": "index.js",
 | 
				
			||||||
  "directories": {
 | 
					  "directories": {
 | 
				
			||||||
@ -21,7 +21,6 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "homepage": "https://github.com/joshuashoemaker/dmein#readme",
 | 
					  "homepage": "https://github.com/joshuashoemaker/dmein#readme",
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "progress": "^2.0.3",
 | 
					 | 
				
			||||||
    "@babel/core": "^7.10.3",
 | 
					    "@babel/core": "^7.10.3",
 | 
				
			||||||
    "@babel/plugin-proposal-class-properties": "^7.10.1",
 | 
					    "@babel/plugin-proposal-class-properties": "^7.10.1",
 | 
				
			||||||
    "@babel/preset-env": "^7.10.3",
 | 
					    "@babel/preset-env": "^7.10.3",
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
import Nodule from '../../core/entities/Nodule.js'
 | 
					import Nodule from '../../src/entities/Nodule.js'
 | 
				
			||||||
import Table from '../../core/entities/Table.js'
 | 
					import Table from '../../src/entities/Table.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const input = {
 | 
					const input = {
 | 
				
			||||||
  id: 'ABC',
 | 
					  id: 'ABC',
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
import FilterNodule from '../../../core/entities/nodules/FilterNodule.js'
 | 
					import FilterNodule from '../../../src/entities/nodules/FilterNodule.js'
 | 
				
			||||||
import Table from '../../../core/entities/Table.js'
 | 
					import Table from '../../../src/entities/Table.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const equalFilter = () => {
 | 
					const equalFilter = () => {
 | 
				
			||||||
  const expectedOutput = [
 | 
					  const expectedOutput = [
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
import JoinNodule from '../../../core/entities/nodules/JoinNodule.js'
 | 
					import JoinNodule from '../../../src/entities/nodules/JoinNodule.js'
 | 
				
			||||||
import Table from '../../../core/entities/Table.js'
 | 
					import Table from '../../../src/entities/Table.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const joinTables = () => {
 | 
					const joinTables = () => {
 | 
				
			||||||
  const pickupTable = new Table({
 | 
					  const pickupTable = new Table({
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
import Table from '../../../core/entities/Table.js'
 | 
					import Table from '../../../src/entities/Table.js'
 | 
				
			||||||
import TransformNodule from '../../../core/entities/nodules/TransformNodule.js'
 | 
					import TransformNodule from '../../../src/entities/nodules/TransformNodule.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const transformTable = () => {
 | 
					const transformTable = () => {
 | 
				
			||||||
  const expectedOutput = [
 | 
					  const expectedOutput = [
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
import Table from '../../core/entities/Table.js'
 | 
					import Table from '../../src/entities/Table.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const input = {
 | 
					const input = {
 | 
				
			||||||
  id: 'abc',
 | 
					  id: 'abc',
 | 
				
			||||||
 | 
				
			|||||||
@ -1,29 +1,20 @@
 | 
				
			|||||||
import ProgressBar from 'progress'
 | 
					// import ProgressBar from 'progress'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import tableTests from '../tests/core/tableTests.js'
 | 
					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 filterNoduleTests from '../tests/core/nodules/filterNoduleTests.js'
 | 
				
			||||||
import joinNoduleTests from '../tests/core/nodules/joinNoduleTests.js'
 | 
					import joinNoduleTests from '../tests/core/nodules/joinNoduleTests.js'
 | 
				
			||||||
import transformNoduleTests from '../tests/core/nodules/transformNoduleTests.js'
 | 
					import transformNoduleTests from '../tests/core/nodules/transformNoduleTests.js'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function runTestsAndReturnFailures (tests) {
 | 
					function runTestsAndReturnFailures (tests) {
 | 
				
			||||||
  const testTotalCount = tests.length
 | 
					  const testTotalCount = tests.length
 | 
				
			||||||
 | 
					  const testsFailed = []
 | 
				
			||||||
  const testBar = new ProgressBar(
 | 
					 | 
				
			||||||
    `\x1b[36mRunning Tests [:bar] :current/${testTotalCount}`,
 | 
					 | 
				
			||||||
    { total: testTotalCount }
 | 
					 | 
				
			||||||
  )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  let testsFailed = []
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  for (let i = 0; i < testTotalCount; i++) {
 | 
					  for (let i = 0; i < testTotalCount; i++) {
 | 
				
			||||||
    const passedTest = tests[i].test()
 | 
					    const passedTest = tests[i].test()
 | 
				
			||||||
    testBar.tick()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!passedTest) testsFailed.push(tests[i].name)
 | 
					    if (!passedTest) testsFailed.push(tests[i].name)
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    if (testBar.complete) return testsFailed
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  return testsFailed
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function init (tests) {
 | 
					function init (tests) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user