Skip to content

Commit

Permalink
deps: skuba 7.0.1 (#194)
Browse files Browse the repository at this point in the history
* deps: skuba 7.0.1

* Fix linting issues and require node 18

* Revert some changes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tadhg Lewis <tadhg.lewis@outlook.com>
  • Loading branch information
renovate[bot] and tadhglewis authored Aug 25, 2023
1 parent 4fa683f commit 42ef63b
Show file tree
Hide file tree
Showing 9 changed files with 1,773 additions and 1,670 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Node.js 16.x
- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Node.js 16.x
- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
13 changes: 0 additions & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

# Gantry resource files support non-standard template syntax
/.gantry/**/*.yaml
/.gantry/**/*.yml
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/supertest": "2.0.12",
"hot-shots": "10.0.0",
"koa": "2.14.2",
"skuba": "6.2.0",
"skuba": "7.0.1",
"supertest": "6.3.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/asyncMiddleware/asyncMiddleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('asyncMiddleware', () => {
state: {},
method: 'GET',
...fields,
} as unknown as Koa.Context);
}) as unknown as Koa.Context;

const next = jest.fn().mockRejectedValue(new Error('why are you here'));

Expand Down
11 changes: 8 additions & 3 deletions src/errorMiddleware/errorMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export class JsonResponse extends Error {
* @param body - JavaScript value used for requests accepting
* `application/json`. This is encoded as JSON in the response.
*/
constructor(message: string, public body: unknown) {
constructor(
message: string,
public body: unknown,
) {
super(message);
}
}
Expand Down Expand Up @@ -90,9 +93,11 @@ export const handle: Middleware = async (ctx, next) => {
ctx.accepts(['application/json', 'text/plain']) === 'application/json'
) {
ctx.body = err.body;
} else {
ctx.body = (expose && err.message) || '';
return;
}

ctx.body = (expose && err.message) || '';
return;
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/metricsMiddleware/metricsMiddleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('metricsMiddleware', () => {
state: {},
method: 'GET',
...fields,
} as unknown as Koa.Context);
}) as unknown as Koa.Context;

it('should record metrics for a successful request', async () => {
const mockDistribution = jest.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/tracingHeaders/tracingHeaders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const mockCtxWithHeaders = (header: Record<string, string>): Koa.Context =>
({
request: { header },
state: {},
} as unknown as Koa.Context);
}) as unknown as Koa.Context;

describe('TracingHeaders', () => {
describe('tracingFromContext', () => {
Expand Down
3,403 changes: 1,757 additions & 1,646 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 42ef63b

Please sign in to comment.