06 2023 档案

摘要:* 原因 EM模块不支持require引入 * 解决 1. 单个文件时,文件的后缀名改为.mjs 2. 多个文件时,在package.json中指定type为module,使用ESM 阅读全文
posted @ 2023-06-14 16:43 信尚 阅读(1276) 评论(0) 推荐(0) 编辑
摘要:原因:CommonJS 中提供的全局变量如require, exports, module.exports, __filename, __dirname 等,在 ES Modules 环境中均是不可用的,require, exports, module.exports 在 ES Modules 中基 阅读全文
posted @ 2023-06-14 16:35 信尚 阅读(1139) 评论(0) 推荐(0) 编辑
摘要:| expect | matcher | more | | | | | | boolean | toBeTruthy() | toBeFalsy() | | object | toStrictEqual() |toEqual() | | exception | toThrow(error) | | 阅读全文
posted @ 2023-06-08 21:52 信尚 阅读(6) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2023-06-07 16:34 信尚 阅读(5) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示