TypeError:dispatchEvent的参数必须是Event

时间:2017-10-17 20:39:37

标签: javascript reactjs unit-testing jestjs enzyme

Jest测试套件在下面的摘录中使用酶v3.0失败。

class OtherClass{
   public int Counter {set; get;}
  .
  .//other logic
  .
}
OtherClass otherClass = new OtherClass();
int count = 0; 
while(playagain != "n")
{
    Console.WriteLine("Please input the score of game 1: ");
    g1 = ReadLine();
    game1 += int.Parse(g1);
    count++;
    Console.WriteLine("Would you like to add more scores? Press 'n' to continue to averaging, press any other key to continue!");
    playagain = ReadLine();        
    Console.Clear();
}
otherClass.Counter = count;

它说

  

TypeError:dispatchEvent的参数必须是Event

0 个答案:

没有答案