Skip to content

Commit

Permalink
Fix tests beeing async that don’t have to be
Browse files Browse the repository at this point in the history
  • Loading branch information
pozylon committed Oct 21, 2024
1 parent ac0eb1a commit 6e32707
Show file tree
Hide file tree
Showing 33 changed files with 729 additions and 614 deletions.
123 changes: 62 additions & 61 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 @@ -52,8 +52,8 @@
"@types/jest": "^29.5.13",
"@types/lodash.clone": "^4.5.9",
"@types/node": "^22.7.7",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"cross-env": "^7.0.3",
"dotenv-extended": "^2.9.0",
"eslint": "^8.57.1",
Expand All @@ -63,7 +63,7 @@
"formdata-node": "^6.0.3",
"graphql": "^16.9.0",
"jest": "^29.7.0",
"mongodb": "^6.9.0",
"mongodb": "^6.10.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.3",
"stripe": "^16.12.0",
Expand Down
8 changes: 3 additions & 5 deletions packages/api/src/fastify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const resolveUserRemoteAddress = (req: IncomingMessage) => {
};

const {
BULK_IMPORT_API_PATH = '/bulk-import',
ERC_METADATA_API_PATH = '/erc-metadata',
GRAPHQL_API_PATH = '/graphql',
UNCHAINED_COOKIE_NAME = 'unchained_token',
UNCHAINED_COOKIE_PATH = '/',
Expand All @@ -50,11 +48,12 @@ const middlewareHook = async function middlewareHook(req: any, reply: any) {
};
await emit(API_EVENTS.API_LOGIN_TOKEN_CREATED, { userId: user._id, ...tokenObject });
/* eslint-disable-next-line */
(user as any)._inLoginMethodResponse = true;
(user as any)._inLoginMethodResponse = true;
return { user, ...tokenObject };
}

async function logout(sessionId?: string) { /* eslint-disable-line */
async function logout() {
/* eslint-disable-line */
if (!req.session?.userId) return false;
const tokenObject = {
_id: (req as any).session.sessionId,
Expand Down Expand Up @@ -83,7 +82,6 @@ export const connect = (
{
graphqlHandler,
db,
unchainedAPI,
}: { graphqlHandler: YogaServerInstance<any, any>; db: mongodb.Db; unchainedAPI: UnchainedCore },
) => {
fastify.register(fastifyCookie);
Expand Down
Loading

0 comments on commit 6e32707

Please sign in to comment.