06 2023 档案
摘要:* 原因 EM模块不支持require引入 * 解决 1. 单个文件时,文件的后缀名改为.mjs 2. 多个文件时,在package.json中指定type为module,使用ESM
阅读全文
摘要:原因:CommonJS 中提供的全局变量如require, exports, module.exports, __filename, __dirname 等,在 ES Modules 环境中均是不可用的,require, exports, module.exports 在 ES Modules 中基
阅读全文
摘要:| expect | matcher | more | | | | | | boolean | toBeTruthy() | toBeFalsy() | | object | toStrictEqual() |toEqual() | | exception | toThrow(error) | |
阅读全文
摘要:error:... is not a constructor reason:The mock can't be an arrow function because calling new on an arrow function is not allowed in JavaScript. > ref
阅读全文