Hapijs 运行 测试忽略泄漏
Hapijs running test ignoring the leaks
我正在使用 HapiJS 构建 Web 应用程序。我正在为我的应用程序编写测试。我正在 运行 使用以下命令进行测试:
lab -v test/**/*.test.js
当我 运行 测试时,即使所有测试都通过了,我仍收到以下错误:
The following leaks were detected:__extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __createBinding, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet
我试图使用以下命令忽略它:
lab -v --globals test/**/*.test.js
lab -v -I test/**/*.test.js
lab -v --ignore test/**/*.test.js
但是上面的 none 个命令有效。我怎样才能忽略该错误?
来自doc
-l
, --leaks
- disables global variable leak detection.
或
-I
, --ignore
- ignore a list of globals for the leak detection (comma separated), this is an alias of globals property in .labrc file. To ignore symbols, pass the symbol's string representation (e.g. Symbol(special)).
.labrc.js 例子
module.exports = {
globals: ['__extends', '__assign', '__rest', ...],
};
你可以查看例子HERE
我正在使用 HapiJS 构建 Web 应用程序。我正在为我的应用程序编写测试。我正在 运行 使用以下命令进行测试:
lab -v test/**/*.test.js
当我 运行 测试时,即使所有测试都通过了,我仍收到以下错误:
The following leaks were detected:__extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __createBinding, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet
我试图使用以下命令忽略它:
lab -v --globals test/**/*.test.js
lab -v -I test/**/*.test.js
lab -v --ignore test/**/*.test.js
但是上面的 none 个命令有效。我怎样才能忽略该错误?
来自doc
-l
,--leaks
- disables global variable leak detection.
或
-I
,--ignore
- ignore a list of globals for the leak detection (comma separated), this is an alias of globals property in .labrc file. To ignore symbols, pass the symbol's string representation (e.g. Symbol(special)).
.labrc.js 例子
module.exports = {
globals: ['__extends', '__assign', '__rest', ...],
};
你可以查看例子HERE