Menu

gitpiper

Tape Cheat Sheet in May 2023

Last Updated: 16 May 2023

README.md

test('things', (t) => {
  t.plan(1)

  t.equal('actual', 'expected')
  t.equal('actual', 'expected', 'should be equal') // messages are optional

  t.end(err)
  t.fail('msg')
  t.pass('msg')
  t.timeoutAfter(2000)
  t.skip('msg')

  t.ok(value, 'is truthy')
  t.notOk(value, 'is falsy')
  t.error(err, 'is falsy (print err.message)')

  t.equal(actual, expected, 'is equal')
  t.notEqual

  t.deepEqual(actual, expected, 'is equal (use node's deepEqual)')
  t.notDeepEqual

  t.looseEqual(actual, expected, 'is equal (use node's deepEqual with ==)')
  t.notLooseEqual

  t.throws(fn, /FooError/)
  t.throws(fn, FooError /* class */)
  t.doesNotThrow

  t.comment('message')
})
test.only((t) => { ... })

338+ more cheat sheets for you in May 2023

Subscribe to our Newsletter

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

© 2023 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! ✌️