TypeError: _Counter.Counter is not a constructor

来源:2-9 Jest 中的钩子函数

martin123_

2019-08-28

TypeError: _Counter.Counter is not a constructor

  1 | import { Counter } from './Counter';
  2 | 
> 3 | const counter = new Counter();
    |                 ^
  4 | test('测试 addOne', () => {
  5 |     counter.addOne()
  6 |     expect(counter.number).toBe(1)

报了这种错,不知道为什么,

写回答

1回答

martin123_

提问者

2019-08-28

已找到原因,谢谢

0
0

前端要学的测试课 从Jest入门到 TDD/BDD双实战

自动化测试实战 Vue / React 项目,让技术水平和架构思维双提升

1434 学习 · 350 问题

查看课程