开玩笑,每次开玩笑都抛出错误,未执行

时间:2019-11-11 14:21:07

标签: jestjs

我正在尝试在循环中运行一些代码,但是会引发错误, 我正在开玩笑,每个开玩笑

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}

0 个答案:

没有答案