Skip to content

Commit

Permalink
Merge pull request #506 from madisonbikes/dependabot/npm_and_yarn/dev…
Browse files Browse the repository at this point in the history
…elop/supertest-and-types/supertest-6.3.4

chore: bump supertest and @types/supertest
  • Loading branch information
bensandee authored Feb 2, 2024
2 parents 6951397 + 4487e9d commit ae3ff11
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
42 changes: 25 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@types/passport": "^1.0.16",
"@types/passport-local": "^1.0.38",
"@types/readline-sync": "^1.4.8",
"@types/supertest": "^2.0.16",
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^6.20",
"@typescript-eslint/parser": "^6.20",
"conventional-changelog-conventionalcommits": "^7.0.2",
Expand All @@ -89,9 +89,9 @@
"prettier": "3.2.4",
"semantic-release": "^23.0.0",
"semantic-release-export-data": "^1.0.1",
"supertest": "^6.3.3",
"supertest": "^6.3.4",
"ts-jest": "^29.1.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.3.3"
}
}
}
5 changes: 3 additions & 2 deletions src/test/request.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import supertest from "supertest";
import { runningPhotoServer, Server } from ".";
import TestAgent from "supertest/lib/agent";
export { Server } from "http";

/** helper type alias for supertest request object */
export type TestRequest = supertest.SuperTest<supertest.Test>;
export type TestRequest = TestAgent;

/** helper function to build a supertest test request from a server object */
export const testRequest = (server?: Server): TestRequest => {
export const testRequest = (server?: Server) => {
const s = server ?? runningPhotoServer;
return supertest.agent(s);
};
4 changes: 2 additions & 2 deletions src/twitter/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Plugin } from "superagent";
export const oauth_signer = (
apiKey: string,
apiSecret: string,
data: Record<string, string>
data: Record<string, string>,
): Plugin => {
const oauth = new OAuth({
consumer: { key: apiKey, secret: apiSecret },
Expand All @@ -25,6 +25,6 @@ export const oauth_signer = (
};
const authorization = oauth.authorize(requestData);
const header = oauth.toHeader(authorization);
void request.set(header);
void request.set("Authorization", header.Authorization);
};
};

0 comments on commit ae3ff11

Please sign in to comment.