0.0.1 • Published 7 years ago

detest v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Detest: Declaritive Unit Testing

STUB unit testing via declaritive examples in code metadata

export const arrayify = meta`
  wraps defined non-array elements in an array,
  always returns an array.

  examples:
    ['foo'] => ['foo']
    'foo' => ['foo']
    undefined => []
    () => []
  
  tests: ${{before, after, fake}}
`(
  function arrayify(val){
    return Array.isArray(val) ? val : (val !== undefined ? [val] : [])
  }
)