|
@ -1,6 +1,8 @@ |
|
|
'use strict'; |
|
|
'use strict'; |
|
|
|
|
|
|
|
|
const { liftPromise, lowerCaseFirstLetter } = require('../util'); |
|
|
const { liftPromise, lowerCaseFirstLetter } = require('../util'); |
|
|
|
|
|
|
|
|
|
|
|
const library = require('./assertionsLibrary'); |
|
|
const assertPromise = require('./assertPromise'); |
|
|
const assertPromise = require('./assertPromise'); |
|
|
|
|
|
|
|
|
const expectPromise = (pred, statement, options = {}) => |
|
|
const expectPromise = (pred, statement, options = {}) => |
|
@ -18,12 +20,11 @@ const expectPromise = (pred, statement, options = {}) => |
|
|
? assertPromise( |
|
|
? assertPromise( |
|
|
pred(toTest, ...testValues), |
|
|
pred(toTest, ...testValues), |
|
|
[ statement, rejectedValue, ...testValues ], |
|
|
[ statement, rejectedValue, ...testValues ], |
|
|
|
|
|
{ skipStatement: rejectedValue }, |
|
|
) |
|
|
) |
|
|
: Promise.reject(rejectedValue) |
|
|
: Promise.reject(rejectedValue) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const library = require('./assertionsLibrary'); |
|
|
|
|
|
|
|
|
|
|
|
const expects = Object.keys(library).reduce((acc, e) => { |
|
|
const expects = Object.keys(library).reduce((acc, e) => { |
|
|
|
|
|
|
|
|
const [ pred, statement, options ] = library[e]; |
|
|
const [ pred, statement, options ] = library[e]; |
|
|