diff --git a/config/test/jest.config.js b/config/test/jest.config.js index 8087d69..7e060f9 100644 --- a/config/test/jest.config.js +++ b/config/test/jest.config.js @@ -18,7 +18,7 @@ module.exports = { }, }, coverageReporters: ['text', 'lcov', 'html', 'json'], - coverageDirectory: 'coverage', + coverageDirectory: '/coverage', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], moduleNameMapper: { '^@/(.*)$': '/src/$1', @@ -33,4 +33,4 @@ module.exports = { testTimeout: 10000, verbose: true, maxWorkers: '50%', -}; \ No newline at end of file +}; diff --git a/config/test/jest.setup.js b/config/test/jest.setup.js index 7c991a8..47ebba4 100644 --- a/config/test/jest.setup.js +++ b/config/test/jest.setup.js @@ -4,37 +4,6 @@ const { TextEncoder, TextDecoder } = require('util'); global.TextEncoder = TextEncoder; global.TextDecoder = TextDecoder; -jest.mock('next-auth', () => { - return { - __esModule: true, - default: jest.fn(() => ({ - handlers: { - authOptions: { - providers: [], - callbacks: {}, - pages: {}, - session: {}, - }, - }, - signIn: jest.fn(), - signOut: jest.fn(), - auth: jest.fn(), - })), - getServerSession: jest.fn(), - }; -}); - -jest.mock('next-auth/providers/credentials', () => - jest.fn(() => ({ - name: '邮箱密码', - credentials: { - email: { label: '邮箱', type: 'email' }, - password: { label: '密码', type: 'password' }, - }, - authorize: jest.fn(), - })) -); - jest.mock('nanoid', () => ({ nanoid: jest.fn(() => 'test-id-123'), })); @@ -191,4 +160,4 @@ global.Response = class Response { async text() { return String(this.body); } -}; \ No newline at end of file +};