为什么我们不只是更换beforeAll(function(){ let foo = 'test' })用let foo = 'test'?beforeAll如果第二种方式没问题,目的是什么?
beforeAll(function(){ let foo = 'test' })
let foo = 'test'
beforeAll
顺便说一下,这是官方定义:在任何beforeEach函数或任何规范之前,beforeAll函数只对包含它的describe块执行一次.
javascript jasmine ecmascript-6
ecmascript-6 ×1
jasmine ×1
javascript ×1