Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

Latest commit

 

History

History
72 lines (58 loc) · 1.77 KB

test.js.md

File metadata and controls

72 lines (58 loc) · 1.77 KB

Snapshot report for test.js

The actual snapshot is saved in test.js.snap.

Generated by AVA.

creates a helper

t.throws(foo())

`function _avaThrowsHelperStart(t, assertion, file, line) {␊
  if (t._throwsArgStart) {␊
    t._throwsArgStart(assertion, file, line);␊
  }␊
}␊

function _avaThrowsHelperEnd(t, arg) {␊
  if (t._throwsArgEnd) {␊
    t._throwsArgEnd();␊
  }␊

  return arg;␊
}␊

t.throws((_avaThrowsHelperStart(t, "throws", "/some-file.js", 1), _avaThrowsHelperEnd(t, foo())));`

creates the helper only once

t.throws(foo()); t.throws(bar());

`function _avaThrowsHelperStart(t, assertion, file, line) {␊
  if (t._throwsArgStart) {␊
    t._throwsArgStart(assertion, file, line);␊
  }␊
}␊

function _avaThrowsHelperEnd(t, arg) {␊
  if (t._throwsArgEnd) {␊
    t._throwsArgEnd();␊
  }␊

  return arg;␊
}␊

t.throws((_avaThrowsHelperStart(t, "throws", "/some-file.js", 1), _avaThrowsHelperEnd(t, foo())));␊
t.throws((_avaThrowsHelperStart(t, "throws", "/some-file.js", 1), _avaThrowsHelperEnd(t, bar())));`

does nothing if it does not match

t.is(foo());

't.is(foo());'

helps notThrows

t.notThrows(baz())

`function _avaThrowsHelperStart(t, assertion, file, line) {␊
  if (t._throwsArgStart) {␊
    t._throwsArgStart(assertion, file, line);␊
  }␊
}␊

function _avaThrowsHelperEnd(t, arg) {␊
  if (t._throwsArgEnd) {␊
    t._throwsArgEnd();␊
  }␊

  return arg;␊
}␊

t.notThrows((_avaThrowsHelperStart(t, "notThrows", "/some-file.js", 1), _avaThrowsHelperEnd(t, baz())));`