repl.it
Nodejs

minimal JS testing

fork
loading
Files
  • index.js
  • src
  • index.browserLog.mjs
  • index.browserPage.mjs
  • index.html
  • index.node.js
  • jsTest.mjs
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const { describe, nodeLog } = require("./jsTest.mjs")
const { testsForAdd } = require("./src/tests/testAdd.mjs")
const { testsForSubt } = require("./src/tests/testSubt.mjs")
const { testsForMult } = require("./src/tests/testMult.mjs")
const { testsForDiv } = require("./src/tests/testDiv.mjs")

// setup describe to send output to node console.
const testMath = describe(nodeLog)

// run tests.
console.log('Testing function add')
testMath('function add', testsForAdd)

console.log('Testing function subt')
testMath('function subt', testsForSubt)

console.log('Testing function mult')
testMath('function mult', testsForMult)

console.log('Testing function div')
testMath('function div', testsForDiv)
node v10.16.0