How to reset global variables before each test?

前端 未结 0 570
忘了有多久
忘了有多久 2021-01-07 06:36

Let\'s say I have a function that returns an id (integer) that increments every time.

let nextId = 0;

const getId = () => nextId++;

export default  getId         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题