import {J} from "../../utils"; import request from "supertest"; import {AppMaster,AppMasterConfig,masterConfig} from "../../../src"; import deepmerge from "deepmerge"; import path from "path"; export const amAppInitTests = () => J.desc("AM Express App Init",() => { let m:AppMaster,c:AppMasterConfig,app:any,routes:any[]; it("init w/o errors",async () => { c = deepmerge(masterConfig("APPMASTER"),{middleware:{ public:{dirname:path.join(__dirname,"/../../../public")}, views:{dirname:path.join(__dirname,"/../../../views")}}}); m = new AppMaster({vars:c.vars,middleware:c.middleware,main:c.main}); J.is(m); routes = m.routes;},1E9); it("has app",async () => J.is(m.app)); it("has routes",async () => { J.arr(routes); J.gt(routes.length,0); console.log({routes})}); it("app server boot",async () => { app = request(m.app); J.is(app);}); });