How to reuse beforeEach/afterEach in Jasmine JS?

后端 未结 4 805
暖寄归人
暖寄归人 2020-11-29 04:19

When writing tests with JasmineJS I have many tests that have similar beforeEach/afterEach code.

Is there a way to implement an inheritance model using JasmineJS tes

4条回答
  •  旧时难觅i
    2020-11-29 05:10

    Reference: (Pivotal Labs Blog:Davis W. Frank)

    He describes collecting shared functionality in a function that is called with parameters for the different individual suites. Calling this function within each suite will execute the common setup/configuration.

    As to splitting tests across files; the file with the shared function can either be included within each page with a

提交回复
热议问题