UNPKG

@atomist/rug

Version:

TypeScript model for Atomist Rugs, see http://docs.atomist.com/

56 lines (55 loc) 1.6 kB
"use strict"; /* * 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 }); var Core_1 = require("./Core"); // Register well-known steps /** * Nothing. Typical starting point for command handler testing. */ Core_1.Given("nothing", function (w) { return; }); /** * Generic event handler registrtion. */ Core_1.Given("([a-zA-Z0-9]+) handler", function (w, handlerName) { w.registerHandler(handlerName); }); /** * No event handler was triggered. */ Core_1.Then("no handler fired", function (w) { return w.plan() === null; }); /** * Valid command handler parameters. */ Core_1.Then("handler parameters were valid", function (w) { return w.invalidParameters() === null; }); /** * Invalid command handler parameters. */ Core_1.Then("handler parameters were invalid", function (w) { return w.invalidParameters() !== null; }); /** * The returned plan has no messages. */ Core_1.Then("plan has no messages", function (world) { return world.plan().messages.length === 0; });