Skip to content

Commit

Permalink
feat(tests): set currentEnvironment to "development" in Koa and Expre…
Browse files Browse the repository at this point in the history
…ss tests
  • Loading branch information
cstrnt committed Feb 17, 2025
1 parent ff0c184 commit 7eedea0
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 60 deletions.
5 changes: 4 additions & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "6.0.0",
"description": "",
"main": "dist/index.js",
"files": ["dist"],
"files": [
"dist"
],
"exports": {
".": {
"require": "./dist/index.js",
Expand Down Expand Up @@ -34,6 +36,7 @@
"@types/koa": "^2.13.12",
"@types/supertest": "^2.0.16",
"express": "^4.19.2",
"get-port": "^7.1.0",
"koa": "^2.14.2",
"msw": "^0.49.1",
"node-fetch": "^3.3.0",
Expand Down
1 change: 1 addition & 0 deletions packages/node/tests/express.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const test2Variants = [
] as const;

const { middleware, abby } = createAbbyMiddleWare({
currentEnvironment: "development",
environments: [],
projectId: "123",
tests: {
Expand Down
7 changes: 5 additions & 2 deletions packages/node/tests/koa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { ABBY_AB_STORAGE_PREFIX } from "@tryabby/core";
import Koa from "koa";
import fetch from "node-fetch";
import { createAbbyMiddleWare } from "../src/koa";
import getPort from "get-port";

const app = new Koa();
const PORT = 5556;
const SERVER_URL = `http://localhost:${PORT}`;
let SERVER_URL = "http://localhost:";

let server: Server | undefined = undefined;

Expand All @@ -19,6 +19,7 @@ const test2Variants = [
] as const;

const { middleware, abby } = createAbbyMiddleWare({
currentEnvironment: "development",
environments: [],
projectId: "123",
tests: {
Expand Down Expand Up @@ -54,7 +55,9 @@ app.use((ctx) => {
});

beforeAll(async () => {
const PORT = await getPort();
server = app.listen(PORT);
SERVER_URL += PORT;
});

afterAll(() => {
Expand Down
Loading

0 comments on commit 7eedea0

Please sign in to comment.