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

sinonjs / sinon / 1694
94%

Build:
DEFAULT BRANCH: master
Ran 24 Mar 2017 02:02AM UTC
Jobs 2
Files 0
Run time 5s
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

pending completion
1694

Pull #1364

travis-ci

web-flow
Added setPromise method to stub.

The setPromise method allows the setting of the promise library
that will be used by the resolve and reject method. If it is not set then it will use the default promise implementation by default.

Example:

```js
var assert = require("assert");
var bluebird = require("bluebird");
var sinon = require("sinon");

my myObject = {};
var myStub = sinon.stub()
    .setPromise(bluebird.Promise)
    .resolves(myObject);

myStub
    // Tap should now be available!!!
    .tap(function(actual) {
        assert.strictEqual(actual, myObject);
    })
    .catch(function(err) {
        console.err("Error", err);
    })
```

Documentation still to come.
Pull Request #1364: Added setPromise method to stub.

1233 of 1492 branches covered (82.64%)

Branch coverage included in aggregate %.

11610 of 12173 relevant lines covered (95.38%)

78.76 hits per line

Coverage Regressions

Lines Coverage ∆ File
33
100.0
../test/stub-test.js
Jobs
ID Job ID Ran Files Coverage
1 1694.1 24 Mar 2017 02:02AM UTC 0
95.38
Travis Job 1694.1
2 1694.2 24 Mar 2017 02:03AM UTC 0
95.38
Travis Job 1694.2
Source Files on build 1694
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1694
  • Pull Request #1364
  • PR Base - master (#1684)
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

© 2026 Coveralls, Inc