我收到“无法从'testing.test.js'找到模块'core-js / modules / es7.symbol.async-iterator'“错误,并显示失败状态为什么会发生这种情况?

问题描述

我收到“无法从'testing.test.js'找到模块'core-js / modules / es7.symbol.async-iterator'“错误,并带有失败状态。为什么会这样?

下面是我正在测试的代码

// testing.test.js
import { add } from 'addFunc';
test('input is number for add function',() => {
  expect(typeof add(1,2)).toBe("number");
});


// addFunc.js
let add = function(a,b) {
  if (typeof a!= "number" || typeof b!= "number") {
    return NaN;
  }
  return a + b;
}

主要是当我直接使用typeof或将typeof的结果分配给变量并将其传递给expect()或返回时,引发上述未找到模块错误通过typeof之类的函数调用获得expect(typeReturnFunc())的结果。

请为该问题提出可能的解决方案。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)