我有一套简单的测试,在某些情况下我想更改模拟模块值,而在某些情况下则不想。有人知道该怎么做吗?
这是我在mockConfig.js文件中的模拟对象
module.exports = {
skillGames: {
leftMenuWidget: {
filterByBadge: 'exclusive',
limit: 6,
title: 'Exclusive games',
},
}
}
当我像这样尝试模拟mockConfig.js 文件进行测试时`
jest.mock('helpers/test/mockConfig', () => ({
__esModule: true,
skillGames: {
leftMenuWidget: {
limit: 6,
title: 'Exclusive games',
},
},
}));
我为所有测试设置了未定义的filterByBadge值,但我需要它仅对于一个测试为未定义