Skip to content

Commit

Permalink
Check for consumer in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimon committed Jul 6, 2024
1 parent 28316b5 commit a81b5e6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions tests/express/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ testCases.forEach(({ name, getApp }) => {
expect(
requests.some(
(r) =>
r.consumer === "test" &&
r.method === "GET" &&
r.path === "/hello" &&
r.status_code === 200 &&
Expand Down
6 changes: 0 additions & 6 deletions tests/express/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import { body, query, validationResult } from "express-validator";
import { useApitally } from "../../src/express/index.js";
import { CLIENT_ID, ENV } from "../utils.js";

declare module "express" {
interface Request {
apitallyConsumer?: string;
}
}

export const getAppWithCelebrate = () => {
const app = express();

Expand Down
1 change: 1 addition & 0 deletions tests/fastify/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe("Plugin for Fastify", () => {
expect(
requests.some(
(r) =>
r.consumer === "test" &&
r.method === "GET" &&
r.path === "/hello" &&
r.status_code === 200 &&
Expand Down
1 change: 0 additions & 1 deletion tests/fastify/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { CLIENT_ID, ENV } from "../utils.js";
export const getApp = async () => {
const app = Fastify({
ajv: { customOptions: { allErrors: true } },
// logger: { level: "error" },
});

await app.register(apitallyPlugin, {
Expand Down
1 change: 1 addition & 0 deletions tests/koa/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ testCases.forEach(({ name, router, getApp }) => {
expect(
requests.some(
(r) =>
r.consumer === "test" &&
r.method === "GET" &&
r.path === "/hello" &&
r.status_code === 200 &&
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["src"],
"include": ["src", "tests"],
"compilerOptions": {
"module": "NodeNext",
"esModuleInterop": true,
Expand Down

0 comments on commit a81b5e6

Please sign in to comment.