all files / dist/ TestRunnerInterfaceGenerator.js

100% Statements 10/10
100% Branches 0/0
100% Functions 5/5
100% Lines 10/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46                                                                       
"use strict";
var typeInfo = require("ts-type-info");
var TestRunnerInterfaceGenerator = (function () {
    /* istanbul ignore next */ function TestRunnerInterfaceGenerator() {
    }
    TestRunnerInterfaceGenerator.prototype.fillFile = function (file) {
        file.addInterface({
            name: "TestRunner",
            isExported: true,
            typeParameters: [{ name: "TActual" }, { name: "TExpected" }],
            methods: [{
                    name: "runTest",
                    returnType: "void",
                    parameters: [{ name: "actual", type: "TActual" }, { name: "expected", type: "TExpected" }]
                }]
        });
        file.addClass({
            name: "StrictEqualTestRunner",
            implementsTypes: ["TestRunner<any, any>"],
            isExported: true,
            constructorDef: {
                parameters: [{
                        name: "assertions",
                        type: "WrapperAssertions",
                        isReadonly: true,
                        scope: typeInfo.ClassConstructorParameterScope.Private
                    }]
            },
            methods: [{
                    name: "runTest",
                    returnType: "void",
                    parameters: [{ name: "actual", type: "any" }, { name: "expected", type: "any" }],
                    onWriteFunctionBody: function (writer) {
                        writer.write("this.assertions.it(\"should have the same value\", () => ").inlineBlock(function () {
                            writer.writeLine("this.assertions.strictEqual(actual, expected);");
                        }).write(");");
                    }
                }]
        });
    };
    return TestRunnerInterfaceGenerator;
}());
exports.TestRunnerInterfaceGenerator = TestRunnerInterfaceGenerator;
 
//# sourceMappingURL=TestRunnerInterfaceGenerator.js.map