testeranto
Version:
the AI powered BDD test framework for typescript projects
74 lines (73 loc) • 2.88 kB
JavaScript
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-object-type */
import testeranto from "../Node";
import { ReportServerOfPort } from "../ReportServerLib";
const specification = (Suite, Given, When, Then) => [
Suite.Default("the http server which is used in development", {
initialization: Given["the http server which is used in development"](["It should serve the front page", "It should serve the ReportApp"], [], [
Then["the frontpage looks good"](),
// Then["the projects page looks good"](),
// Then["a project page looks good"](),
// Then["a test page looks good"](),
]),
}),
];
const implementation = {
suites: {
Default: "the http server which is used in development",
},
givens: {
"the http server which is used in development": function (subject) {
// throw new Error("Function not implemented.");
return subject;
},
},
// There are no "whens", it is a stateless server.
whens: {},
thens: {
"the frontpage looks good": async (port, utils) => {
// throw new Error("Function not implemented.");
// utils.newPage(`localhost:${port}`);
debugger;
const page = await utils.newPage();
utils.goto(page, `localhost:${port}`);
utils.customScreenShot({ path: `frontpage.png` }, page);
return;
},
"the projects page looks good": function () {
throw new Error("Function not implemented.");
},
"a project page looks good": function () {
throw new Error("Function not implemented.");
},
"a test page looks good": function () {
throw new Error("Function not implemented.");
},
},
};
const adapter = {
assertThis: function (x) {
throw new Error("Function not implemented.");
},
andWhen: function (store, whenCB, testResource, pm) {
throw new Error("Function not implemented.");
},
butThen: function (store, thenCB, testResource, pm) {
throw new Error("Function not implemented.");
},
afterAll: function (store, pm) {
throw new Error("Function not implemented.");
},
afterEach: function (store, key, pm) {
throw new Error("Function not implemented.");
},
beforeAll: async function (input, testResource, pm) {
await new Promise((res, rej) => input(testResource.ports[0]));
return testResource.ports[0];
},
beforeEach: function (subject, initializer, testResource, initialValues, pm) {
throw new Error("Function not implemented.");
},
};
export default testeranto(ReportServerOfPort, specification, implementation, adapter);