"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
|