@atomist/rug
Version:
TypeScript model for Atomist Rugs, see http://docs.atomist.com/
54 lines (53 loc) • 1.85 kB
JavaScript
;
/*
* Copyright © 2017 Atomist, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
require("./WellKnownSteps");
function Given(s, f) {
com_atomist_rug_test_gherkin_GherkinRunner$_definitions.Given(s, f);
}
exports.Given = Given;
function When(s, f) {
com_atomist_rug_test_gherkin_GherkinRunner$_definitions.When(s, f);
}
exports.When = When;
/**
* A Then step can return a Result object, containing a result and details,
* a boolean indicating pass or fail, or void.
* A successful void return is equivalent to true, while throwing an Error
* means failure. The void return style allows idiomatic use of assertion frameworks
* such as chai.
*/
function Then(s, f) {
com_atomist_rug_test_gherkin_GherkinRunner$_definitions.Then(s, f);
}
exports.Then = Then;
/**
* Convenient assertion if you are not using an assertion framework
* such as chai
*/
function rugAssert(statement, message) {
if (!statement.apply(null)) {
throw new Error("Assertion failed: " + message + ". Code was [" + statement + "]");
}
}
exports.rugAssert = rugAssert;
function rugAssertEqual(a, b) {
if (!(a === b)) {
throw new Error("Assertion failed: " + a + " did not equal " + b);
}
}
exports.rugAssertEqual = rugAssertEqual;