Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

testify

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testify

simple asynchronous testing using assertions of your choice

  • 0.1.3
  • npm
  • Socket score

Version published
Weekly downloads
200
increased by51.52%
Maintainers
1
Weekly downloads
 
Created
Source

Testify

Simple, asynchronous testing, using the assertions of your choice.

Written in CoffeeScript; will start compiling to JS at some point soon.

Basic usage


Testify.test "a suite of tests", (context) ->
  # When you need to test the results of an asynchronous function,
  # give context.test() a function that takes an argument.  You can
  # then use that argument as a new context for nesting tests.
  context.test "testing something asynchronous", (context) ->
    async_call (error, result1) ->
      # If you give context.test() a function that takes no arguments,
      # the test is assumed to be synchronous, and considered to have
      # passed if the function runs without throwing an error.
      context.test "result makes me happy", ->
        assert.ifError(error)
        assert.equal(result1, "pie")

      context.test "a nested asynchronous test", (context) ->
        another_async_call result1,  (error, result2) ->
          context.test "result makes me deeply happy", ->
            assert.ifError(error)
            assert.deepEqual result2, ["bacon", "cheese", "pie"]

      context.test "shortcut for passing an async test", (context) ->
        process.nextTick ->
          # you can call context.pass() instead of using a synchronous test
          context.pass()

FAQs

Package last updated on 08 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc