• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

avajs / ava
97%
master: 42%

Build:
Build:
LAST BUILD BRANCH: magic-assert
DEFAULT BRANCH: master
Repo Added 17 May 2016 01:53PM UTC
Files 204
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fail-if-test-ends-with-pending-assertions
branch: fail-if-test-ends-with-pending-assertions
CHANGE BRANCH
x
Reset
  • fail-if-test-ends-with-pending-assertions
  • 0.15
  • add-avacasts
  • allow-assertions-while-pending
  • api-test-cleanup
  • avoid-helper-compilation-during-api-tests
  • babelrc-recipe-cleanup
  • better-throws-helper
  • browser-support
  • bump-ava-files
  • cb-end-ts
  • change-babel-hook-test
  • clarify-api-directories
  • cleanup-api
  • cleanup-caching-precompiler
  • code-excerpt-fixes
  • coverage-report-html
  • document-helper-caveat-in-code
  • ensure-test-files-load-correct-ava
  • ensure-test-run-failures-crash-worker
  • extract-babel-presets
  • failure-output
  • faster-flow-check
  • fix-enhanced-formatting
  • fix-get-port-usage
  • fix-windows-cli
  • format-actual-objects
  • improve-tap-reporter
  • improve-travis-caching
  • improving-languange-support
  • link-to-contrib-post
  • lodash-difference
  • magic-assert
  • make-snapshot-work
  • master
  • max-listeners
  • more-assertion-changes
  • more-async-pitfalls
  • no-color-disables-formatting-highlights
  • no-power-assert
  • pitfalls-eslint-plugin
  • pr1145
  • precompile-helpers-fixtures
  • reduce-transpilation
  • refactor-assertions
  • remove-dead-flow-types
  • remove-duplicate-test
  • replace-snapshot
  • rethrow-watch-logger-errors
  • stub-stderr-write
  • switch-deep-equal
  • test-arguments-correction
  • test-overhaul
  • update-ava-files
  • upgrade-xo
  • use-hullabaloo
  • use-kathryn
  • v0.15.0
  • v0.15.1
  • v0.15.2
  • v0.16.0
  • v0.17.0
  • v0.18.0
  • v0.18.1
  • v0.18.2
  • v0.19.0
  • v0.19.1

pending completion
3236

push

travis-ci

novemberborn
Fail tests that finish with pending assertions

`t.throws()` and `t.notThrows()` can be called with an observable or
promise. This commit forces users to wait for the assertion to complete
before finishing the test. Usually this means the test has to be written
like:

```js
test(async t => {
  await t.throws(Promise.reject(new Error()))
})
```

Or for callback tests:

```js
test.cb(t => {
  t.throws(Promise.reject(new Error())).then(t.end)
})
```

This simplifies internal logic and helps discourage code like in #1327.
Anecdotally users are surprised by the previous behavior where a
synchronous test worked with an asynchronous assertion
(https://github.com/avajs/ava/issues/1327#issuecomment-291122432).

Fixes #1327.

965 of 1037 branches covered (93.06%)

12 of 12 new or added lines in 1 file covered. (100.0%)

2059 of 2125 relevant lines covered (96.89%)

589.17 hits per line

Relevant lines Covered
Build:
Build:
2125 RELEVANT LINES 2059 COVERED LINES
589.17 HITS PER LINE
Source Files on fail-if-test-ends-with-pending-assertions
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
3236 fail-if-test-ends-with-pending-assertions Fail tests that finish with pending assertions `t.throws()` and `t.notThrows()` can be called with an observable or promise. This commit forces users to wait for the assertion to complete before finishing the test. Usually this means the test has... push 03 Apr 2017 01:21PM UTC novemberborn travis-ci pending completion  
See All Builds (939)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc