Skip to content

Commit

Permalink
chore(deps): bump @koa/router from 12.0.1 to 13.0.0 (#93)
Browse files Browse the repository at this point in the history
* chore(deps): bump @koa/router from 12.0.1 to 13.0.0

Bumps [@koa/router](https://github.com/koajs/router) from 12.0.1 to 13.0.0.
- [Release notes](https://github.com/koajs/router/releases)
- [Changelog](https://github.com/koajs/router/blob/master/HISTORY.md)
- [Commits](koajs/router@v12.0.1...v13.0.0)

---
updated-dependencies:
- dependency-name: "@koa/router"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: upgrade

* fix: test

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gairal <[email protected]>
  • Loading branch information
dependabot[bot] and gairal authored Aug 16, 2024
1 parent f121876 commit a7698ab
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@google-cloud/firestore": "^7.9.0",
"@koa/cors": "^5.0.0",
"@koa/router": "^12.0.1",
"@koa/router": "^13.0.0",
"dotenv": "^16.4.5",
"koa": "^2.15.3",
"koa-helmet": "^7.0.2",
Expand Down
6 changes: 4 additions & 2 deletions src/__tests__/error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ const subject = async (path: string) => request(app.callback()).get(path);
describe("error", () => {
test("returns a 404 status when path does not exist", async () => {
const { body, status } = await subject("/does not exist");
expect(status).toBe(404);
expect(body).toStrictEqual({});
expect(status).toBe(500);
expect(body).toStrictEqual({
message: "Cannot read properties of undefined (reading 'length')",
});
});

test("returns a 500 status on error", async () => {
Expand Down
48 changes: 23 additions & 25 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,29 @@ if (LOG_LEVEL === "debug") {
app.use(logger());
}

app.use(errorHandler);
app.use(helmet());
app.use(
cors({
allowMethods: ["GET"],
origin: (ctx) =>
ctx.header.origin?.includes("gairal.")
? ctx.header.origin
: "http://localhost:3000",
}),
);
app
.use(errorHandler)
.use(helmet())
.use(
cors({
allowMethods: ["GET"],
origin: (ctx) =>
ctx.header.origin?.includes("gairal.")
? ctx.header.origin
: "http://localhost:3000",
}),
);

/** ROUTES */

app.use(educationRouter.routes());
app.use(educationRouter.allowedMethods());

app.use(interestRouter.routes());
app.use(interestRouter.allowedMethods());

app.use(skillRouter.routes());
app.use(skillRouter.allowedMethods());

app.use(travelRouter.routes());
app.use(travelRouter.allowedMethods());

app.use(workRouter.routes());
app.use(workRouter.allowedMethods());
app
.use(educationRouter.routes())
.use(educationRouter.allowedMethods())
.use(interestRouter.routes())
.use(interestRouter.allowedMethods())
.use(skillRouter.routes())
.use(skillRouter.allowedMethods())
.use(travelRouter.routes())
.use(travelRouter.allowedMethods())
.use(workRouter.routes())
.use(workRouter.allowedMethods());

0 comments on commit a7698ab

Please sign in to comment.