Skip to content

Commit

Permalink
feat(core): 📦 test-suite implementation
Browse files Browse the repository at this point in the history
test-suite implementation with suite.test.ts

Ref #123
  • Loading branch information
Animesh1432 committed May 15, 2024
1 parent d560bb4 commit 8d97c5b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions test/test/suite.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { beforeAll, describe } from "@jest/globals";
import { DEFAULT_PORT, WrappidApp } from "@wrappid/service-core";
import { WrappidTestSuite } from "@wrappid/test-suite";

import packageJson from "./../../package.json";
import applicationConfig from "./../../src/config.json";
import ControllersRegistry from "./../../src/registry/ControllersRegistry";
import FunctionsRegistry from "./../../src/registry/FunctionsRegistry";
import MiddlewaresRegistry from "./../../src/registry/MiddlewaresRegistry";
import ModelsRegistry from "./../../src/registry/ModelsRegistry";
import RoutesRegistry from "./../../src/registry/Routes.Registry";
import TasksRegistry from "./../../src/registry/TasksRegistry";
import ValidationsRegistry from "./../../src/registry/ValidationsRegistry";
import swaggerJson from "./../../src/swagger-output.json";

let wrappidApp: WrappidApp;

beforeAll(async () => {
await wrappidApp.init();
}, 20000);

describe("Wrappid Automation Testing Suite", () => {
const __PORT = process.env.PORT || DEFAULT_PORT;

wrappidApp = new WrappidApp({
port: __PORT,
cors: { origin: "*" },
bodyPerser: {
json: { limit: "50mb" },
raw: {
inflate: true,
limit: "50mb",
type: "application/octet-stream",
},
urlencoded: { extended: true }
},
registry: {
ControllersRegistry,
FunctionsRegistry,
ModelsRegistry,
RoutesRegistry,
TasksRegistry,
MiddlewaresRegistry,
ValidationsRegistry
},
swagger: { ...swaggerJson },
config: { ...applicationConfig },
package: {...packageJson}
});

new WrappidTestSuite(wrappidApp).init();
});

0 comments on commit 8d97c5b

Please sign in to comment.