1.0.13 • Published 3 years ago

test_waters v1.0.13

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

test_waters

License: MIT NPM Downloads Play with docs

Instructions:

npm install test_waters
const test_waters =  require('test_waters')

If utilizing in html...:

<script src="./node_modules/test_waters/index.js"></script>
<script> 
$(()=> { 
     const output =  test_waters.method(parameter)
 })
</script>

Functions

testAllTypes(name, export) ⇒ array

Kind: global function
Date: 2022-03-06
Author: zen-out

ParamTypeDescription
namestring
exportfunctionfunction to pass in random inputs

Example

export function justPrint(input) {
    return "waters" + input;
}
let getAll = test_waters.testAllTypes("just print", justPrint)
console.log("🚀 ~ file: playground.js ~ line 7 ~ getAll", getAll)

testFunction(name, func, array) ⇒ array

Kind: global function
Date: 2022-03-16
Author: zen-out

ParamType
namestring
funcfunction
arrayarray

Example

let inputs = [
  { id: 1, name: "lesley" }, { id: 2, name: "ryan" }
]
export function addToDatabase(object) {
  object["added"] = "done"
  return object;
}
let result = test_waters.testFunction("add to database", addToDatabase, inputs)
console.log("🚀 ~ file: playground.js ~ line 34 ~ result", result)

testAsyncFunction(name, func, array) ⇒ array

testAsyncFunction(name, func, array of objects for input testing)

Kind: global function
Date: 2022-03-16
Author: zen-out

ParamType
namestring
funcfunction
arrayarray

Example

async export function resolveAfter2Seconds(object) {
  let getPromise = await new Promise(resolve => {
      setTimeout(() => {
          resolve(object);
      }, 2000);
  });
  return getPromise
}
async export function getTest() {
  let results = await test_waters.testAsyncFunction("async", resolveAfter2Seconds, inputs)
  console.log(results)
}
getTest()
1.0.2

3 years ago

1.0.1

3 years ago

1.0.9

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.0

3 years ago