= 2;// throws an error console.log(error)}但是当我使用eval()函数时,它不会抛出一个错误// not throws an error console.log(error)}我做了常量的局部,函数eval确实按预期抛出了一个错误eval("a = 2;")/
进行测试: expect(testFunction(1)).to.throw(TypeError);expect(testFunction("test string")).to.throw(TypeError);这是我正在测试的一个函数: if (typeof arg === "number" || type