mirror of
https://github.com/xuexb/github-bot.git
synced 2025-12-08 17:36:07 +00:00
* feat: add test command * feat: add a test case * feat: add coverage report * docs: add coverage badge * fix: 优化代码 * test: 添加单元测试 * test: 修复测试用命代码格式 * fix: eslint errors * fix: disable camelcase * fix: disable camelcase for src/github.js
12 lines
313 B
JavaScript
12 lines
313 B
JavaScript
/**
|
|
* @file 清除 node 缓存,以根目录为基础路径
|
|
* @author xuexb <fe.xiaowu@gmail.com>
|
|
*/
|
|
|
|
const resolve = require('path').resolve
|
|
const extname = require('path').extname
|
|
|
|
module.exports = path => {
|
|
delete require.cache[resolve(__dirname, '../../', path) + (extname(path) === '' ? '.js' : '')]
|
|
}
|