You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
359 B
20 lines
359 B
const Shotgun = require('shotgun-query');
|
|
|
|
module.exports = (expectable, expect, docs) => {
|
|
const unitExpects = [];
|
|
|
|
if (expectable.checks) {
|
|
|
|
unitExpects.push(expect(expectable.checks).isArray());
|
|
|
|
expectable.checks.forEach(check =>
|
|
|
|
unitExpects.push(
|
|
new Shotgun(check).eval(docs).call(expect))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return Promise.all(unitExpects);
|
|
};
|
|
|