Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Feb 23, 2025
1 parent c1ae890 commit 683292d
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jest.config.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const jestConfig = {
moduleNameMapper: {
// map SVG to something that Jest can read - could be used for other extensions as well?
// source: https://github.com/vercel/next.js/discussions/42535#discussioncomment-4828013
'^.+\\.(svg)$': require.resolve('./testing/fileMock.js')
'^.+\\.(svg)$': require.resolve('@packages/testing/fileMock.js')
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/collabland/__tests__/connectSpace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { v4 } from 'uuid';

const collablandApiUrl = 'https://fakedomain.com';

jest.mock('config/constants', () => ({
jest.mock('@packages/utils/constants', () => ({
authSecret: 'testsecret1234567890',
isTestEnv: true
}));
Expand Down
2 changes: 1 addition & 1 deletion lib/farcaster/__tests__/ensureFarcasterUserExists.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getFarcasterUsers } from '../getFarcasterUsers';
jest.mock('../getFarcasterUsers');
jest.mock('@packages/utils/strings');
jest.mock('@packages/utils/blockchain');
jest.mock('lib/profile/isProfilePathAvailable');
jest.mock('@packages/profile/isProfilePathAvailable');

describe('ensureFarcasterUserExists', () => {
it('should return existing Farcaster user if already in the database', async () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/featureFlag/__tests__/isCharmVerseSpace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('isCharmVerseSpace', () => {
// Optional: Only if the isDevEnv variable behavior is clear and testable
it('should return true in a development environment regardless of the domain', async () => {
// Dynamically mock the module only for this test
jest.doMock('config/constants', () => ({
jest.doMock('@packages/utils/constants', () => ({
isDevEnv: true
}));

Expand Down
2 changes: 1 addition & 1 deletion lib/summon/__tests__/syncSummonSpaceRoles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { v4 } from 'uuid';

import { syncSummonSpaceRoles } from '../syncSummonSpaceRoles';

jest.mock('lib/profile/getSummonProfile', () => ({
jest.mock('@packages/profile/getSummonProfile', () => ({
getSummonProfile: jest.fn().mockResolvedValue(null)
}));

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/__tests__/dataEncryption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { v4 } from 'uuid';

import { decryptData, encryptData } from '../dataEncryption';

jest.mock('config/constants', () => ({
jest.mock('@packages/utils/constants', () => ({
authSecret: 'testsecret1234567890'
}));

Expand Down
2 changes: 1 addition & 1 deletion pages/api/pages/[id]/threads.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import nc from 'next-connect';

import { NotFoundError, onError, onNoMatch, requireUser } from 'lib/middleware';
import { onError, onNoMatch, requireUser } from 'lib/middleware';
import { permissionsApiClient } from 'lib/permissions/api/client';
import { withSessionRoute } from 'lib/session/withSession';
import { getPageThreads } from 'lib/threads/getPageThreads';
Expand Down
3 changes: 2 additions & 1 deletion pages/api/pages/[id]/votes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NotFoundError } from '@packages/nextjs/errors';
import type { NextApiRequest, NextApiResponse } from 'next';
import nc from 'next-connect';

import { NotFoundError, onError, onNoMatch } from 'lib/middleware';
import { onError, onNoMatch } from 'lib/middleware';
import { permissionsApiClient } from 'lib/permissions/api/client';
import { withSessionRoute } from 'lib/session/withSession';
import { getVotesByPage } from 'lib/votes/getVotesByPage';
Expand Down
3 changes: 2 additions & 1 deletion pages/api/payment-methods/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { InvalidInputError } from '@charmverse/core/errors';
import type { PaymentMethod, Prisma } from '@charmverse/core/prisma';
import { prisma } from '@charmverse/core/prisma-client';
import { ApiError } from '@packages/nextjs/errors';
import { isUniqueConstraintError } from '@packages/utils/errors/prisma';
import type { NextApiRequest, NextApiResponse } from 'next';
import nc from 'next-connect';

import { ApiError, onError, onNoMatch, requireKeys, requireSpaceMembership } from 'lib/middleware';
import { onError, onNoMatch, requireKeys, requireSpaceMembership } from 'lib/middleware';
import { withSessionRoute } from 'lib/session/withSession';
import { isValidChainAddress } from 'lib/tokens/validation';

Expand Down
3 changes: 2 additions & 1 deletion pages/api/proposals/[id]/rewards.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { log } from '@charmverse/core/log';
import { InvalidStateError } from '@packages/nextjs/errors';
import type { NextApiRequest, NextApiResponse } from 'next';
import nc from 'next-connect';

import { onError, onNoMatch, requireUser, InvalidStateError } from 'lib/middleware';
import { onError, onNoMatch, requireUser } from 'lib/middleware';
import { permissionsApiClient } from 'lib/permissions/api/client';
import { createRewardsForProposal } from 'lib/proposals/createRewardsForProposal';
import { withSessionRoute } from 'lib/session/withSession';
Expand Down

0 comments on commit 683292d

Please sign in to comment.