From 170af605fc2d6b12e30351f73000bacf47a2280a Mon Sep 17 00:00:00 2001 From: William Chong Date: Thu, 23 Nov 2023 02:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Fix=20failing=20jest=20test=20due?= =?UTF-8?q?=20to=20axios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jest.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jest.config.js b/jest.config.js index 689f97f..79621d8 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,8 @@ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ module.exports = { + moduleNameMapper: { + axios: 'axios/dist/node/axios.cjs', // https://stackoverflow.com/a/74297004 + }, preset: 'ts-jest', testEnvironment: 'node', testPathIgnorePatterns: ['/node_modules/', 'dist'],