UNPKG

alsatian-fluent-assertions

Version:

Fluent assertions extension to Alsatian xUnit framework.

49 lines (48 loc) 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const alsatian_1 = require("alsatian"); const matchers_1 = require("./matchers"); function Assert(value, ctxt) { return new matchers_1.PropertiesMatcherWithHelpers(value, undefined, true, null, ctxt); } exports.Assert = Assert; // human reader: this is all just a way to ensure fail exists statically on Assert ^^^. // istanbul ignore next // tslint:disable-next-line (function (Assert) { let container; /** * Fails the test with the given message * @param message - the message that will be shown in the failure */ function fail(message) { throw new alsatian_1.MatchError(message); } Assert.fail = fail; /** * Not yet used. Configures an Assert factory for spec-aware assertions. For example, * it allows the test framework to alert you when you forgot to complete * an assertion (i.e., this.assert(something) and forgetting .equals(...)). * @param container The specification container instance. */ function configure(ctxt) { return (value) => { return Assert(value, container); }; } Assert.configure = configure; /** * Validates any assertions within the current context. Intended to be used * in conjuction with Assert.configure (in @Setup/@AsyncSetup) inside of a * @Teardown or @AsyncTeardown method. If a specification class extends BaseSpec, * then configuration and validation will be called automatically. */ function validateAssertions(ctxt) { throw new Error("Not implemented."); /*for (let assertion in ctxt.assertions) { }*/ } Assert.validateAssertions = validateAssertions; })(Assert || (Assert = {})); exports.Assert = Assert; //# sourceMappingURL=assert.js.map