This package has been deprecated

Author message:

Nobody uses this thing and it may have bugs. It's not recommended to use it

must-promise

1.0.0 • Public • Published

must-return

This library adds is a promise assertion to Must.js. Internally it checks if object has a then property and if it's chainable. With strict check (by default) it also checks for catch property.

Install

npm install must-promise

Usage

require("must-promise"); // This will internally require must and upgrade its prototype.

const q = require("q");
describe("Some tests", () => {
    it("detects promises", () => {
        q().must.be.a.promise();
        Promise.resolve().must.be.a.promise();
    });

    it("detects not-promises", () => {
        "5".must.not.be.a.promise();
        true.must.not.be.a.promise();
    });
    
    it("will fail on unchainable promise-like thing", () => {
        ({ then: function() {} }).must.not.be.a.promise();
    });
});

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i must-promise

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dzek69