-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] run
nyc
on all tests; use tape
runner; add `implementatio…
…n` tests
- Loading branch information
Showing
4 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"all": true, | ||
"check-coverage": false, | ||
"reporter": ["text-summary", "text", "html", "json"], | ||
"lines": 86, | ||
"statements": 85.93, | ||
"functions": 82.43, | ||
"branches": 76.06, | ||
"exclude": [ | ||
"coverage", | ||
"test" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
var test = require('tape'); | ||
var callBind = require('call-bind'); | ||
|
||
var any = require('../implementation'); | ||
var runTests = require('./tests'); | ||
|
||
var bound = callBind(any); | ||
|
||
// eslint-disable-next-line no-shadow | ||
var rebindable = function any(iterable) { | ||
// eslint-disable-next-line no-invalid-this | ||
return bound(typeof this === 'undefined' ? Promise : this, iterable); | ||
}; | ||
|
||
test('as a function', function (t) { | ||
t.test('bad Promise/this value', function (st) { | ||
// eslint-disable-next-line no-useless-call | ||
st['throws'](function () { any.call(undefined, []); }, TypeError, 'undefined is not an object'); | ||
|
||
// eslint-disable-next-line no-useless-call | ||
st['throws'](function () { any.call(null, []); }, TypeError, 'null is not an object'); | ||
st.end(); | ||
}); | ||
|
||
runTests(rebindable, t); | ||
|
||
t.end(); | ||
}); |