fix: swagger apis path to src/ + update stale signup/verify test refs
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
- swagger.ts: changed apis glob from dist/routes/*.js to src/routes/*.ts so OpenAPI spec includes demo endpoints during tests (fixes 6 test failures) - Dockerfile: copy src/ to final stage for runtime swagger-jsdoc - Updated stale /v1/signup/verify test refs to /v1/signup/free (endpoint was removed when free tier was discontinued)
This commit is contained in:
parent
9e1d4d86fb
commit
392fc029fe
4 changed files with 8 additions and 6 deletions
|
|
@ -53,6 +53,7 @@ RUN npm install --omit=dev
|
|||
# Copy compiled artifacts from builder stage
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/src ./src
|
||||
|
||||
# Recreate swagger-ui symlink in production stage
|
||||
RUN rm -f public/swagger-ui && ln -s /app/node_modules/swagger-ui-dist public/swagger-ui
|
||||
|
|
|
|||
|
|
@ -101,9 +101,10 @@ describe("App-level routes", () => {
|
|||
spec = res.body;
|
||||
});
|
||||
|
||||
it("includes POST /v1/signup/verify", () => {
|
||||
expect(spec.paths["/v1/signup/verify"]).toBeDefined();
|
||||
expect(spec.paths["/v1/signup/verify"].post).toBeDefined();
|
||||
it("includes POST /v1/signup/free (deprecated)", () => {
|
||||
expect(spec.paths["/v1/signup/free"]).toBeDefined();
|
||||
expect(spec.paths["/v1/signup/free"].post).toBeDefined();
|
||||
expect(spec.paths["/v1/signup/free"].post.deprecated).toBe(true);
|
||||
});
|
||||
|
||||
it("excludes GET /v1/billing/success (browser redirect, not public API)", () => {
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ describe("OpenAPI spec accuracy", () => {
|
|||
expect(spec.paths).not.toHaveProperty("/v1/billing/success");
|
||||
});
|
||||
|
||||
it("should mark /v1/signup/verify as deprecated", () => {
|
||||
expect(spec.paths["/v1/signup/verify"]?.post?.deprecated).toBe(true);
|
||||
it("should mark /v1/signup/free as deprecated", () => {
|
||||
expect(spec.paths["/v1/signup/free"]?.post?.deprecated).toBe(true);
|
||||
});
|
||||
|
||||
describe("Rate limit headers", () => {
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ const options: swaggerJsdoc.Options = {
|
|||
},
|
||||
},
|
||||
},
|
||||
apis: ["./dist/routes/*.js", "./dist/index.js"],
|
||||
apis: ["./src/routes/*.ts", "./src/index.ts"],
|
||||
};
|
||||
|
||||
export const swaggerSpec = swaggerJsdoc(options);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue