-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): 📦 test-suite implementation
test-suite implementation with suite.test.ts Ref #123
- Loading branch information
1 parent
d560bb4
commit 8d97c5b
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |