我正在尝试在循环中运行一些代码,但是会引发错误, 我正在开玩笑,每个开玩笑
const {host_post,each} = require('./host')
const total_tables = [
"first_table",
"second_table",
"third_table",
"fourth table"
];
each(total_tables).test("test_all_reference %s",async (table)=>{
const options = {
uri:host_post+"api/newReference/getall",
method:"post",
json:{"table_name":table}
}
await request(options,(e,r,b)=>{
if(e || r.statusCode != 200){
throw new Error
}
})
})
host.js
const host_post = "http://some_ip:some_port/api/"
const each = require('jest-each').default;
module.exports = {host_post,each}