assertthat
Version:
assertthat provides fluent TDD.
18 lines (17 loc) • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertArrayIsEmpty = void 0;
const errors_1 = require("../../errors");
const dispel_1 = require("../../dispel/dispel");
const prettyPrint_1 = require("../../prettyPrint/typeAware/prettyPrint");
const defekt_1 = require("defekt");
const assertArrayIsEmpty = function (actual) {
if (actual.length === 0) {
return (0, defekt_1.value)();
}
return (0, defekt_1.error)(new errors_1.AssertionFailed({
message: 'The array is not empty.',
actual: (0, prettyPrint_1.prettyPrint)((0, dispel_1.dispel)(actual))
}));
};
exports.assertArrayIsEmpty = assertArrayIsEmpty;