Skip to content

Commit

Permalink
test: add tests for .then on the prototype (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ForbesLindesay authored Apr 26, 2020
1 parent 19c6d89 commit e5e834a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
var assert = require('assert');
var isPromise = require('./');

// `.then` methods on primative types should
// not make them count as promises
String.prototype.then = () => {};
Number.prototype.then = () => {};
Boolean.prototype.then = () => {};

assert(isPromise(null) === false);
assert(isPromise(undefined) === false);
Expand Down

0 comments on commit e5e834a

Please # to comment.