Menu

gitpiper

Vows Cheat Sheet in April 2024

Last Updated: 20 April 2024

README.md

CoffeeScript usage

vows = require "vows"
assert = require "assert"

vows
  .describe('My tests')
  .addBatch
    'context':
      topic: ->
        100
      'should work': (number) ->
        assert.equal number, 100

  .export(module)

Running

vows test/*-test.* --spec

Assertions

assert.equal a, b
assert.notEqual a, b
assert.strictEqual a, b

assert.isNaN(number)
assert.instanceOf(object, klass)
assert.isUndefined(object)
assert.isFunction(func)
assert.isNull(object)
assert.isNotZero(object)
assert.isObject(object)
assert.isString(object)

Async

.addBatch
  topic: ->
    doStuff()
    @callback 2
  'check things': (n) ->
    assert.equal 2, n

338+ more cheat sheets for you in April 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️