javascript - hapi/lab (and jest): 有没有办法在单独的 js 文件中有一个描述块?
问题描述
我正在使用 nodejs 中的 hapi/lab 编写测试脚本。我想要一个使用 hapi.server 注入 http 选项(模拟集成测试)的描述块。就像是:
main.test.js: ...
describe('main', async () => {
before(async () => {...}
describe('inner-main', async() => {
**externalDescribe**(some params that exists in this file)
it('test specific to this file', async () => {...})
})
})
外部文件.test.js: ...
function **externalDescribe**(some params) {
describe('external', async () => {
it('first it', async () => {
...
})
})
}
或类似的东西。
解决方案
推荐阅读
- react-native - RNPickerSelect 试图从数组中对象的映射数据中显示选择
- r - 如何停止闪亮仪表板的自动关闭
- laravel - 如何修复 laravel 中的“未定义变量:img_name”错误
- c++ - 逐段、逐行读取单词 (C++)
- javascript - 将拖动的文件附加到 div
- reporting-services - 如何在 SSRS 报告上打印 ★ 符号
- c - 如果当前用户的用户名包含 Unicode 字符,getenv("APPDATA") 将返回不正确的值
- php - 在角色之后过滤用户
- swift - tableView.selectRow has no effect when called within a UIContextualAction callback
- python - 正在发送的 python 邮件有一个空白的 TO 字段