| 39 | } |
| 40 | |
| 41 | export const makeDescribe = ( |
| 42 | name: Circus.BlockName, |
| 43 | parent?: Circus.DescribeBlock, |
| 44 | mode?: Circus.BlockMode, |
| 45 | ): Circus.DescribeBlock => { |
| 46 | let _mode = mode; |
| 47 | if (parent && !mode) { |
| 48 | // If not set explicitly, inherit from the parent describe. |
| 49 | _mode = parent.mode; |
| 50 | } |
| 51 | |
| 52 | return { |
| 53 | type: 'describeBlock', // eslint-disable-next-line sort-keys |
| 54 | children: [], |
| 55 | hooks: [], |
| 56 | mode: _mode, |
| 57 | name: convertDescriptorToString(name), |
| 58 | parent, |
| 59 | tests: [], |
| 60 | }; |
| 61 | }; |
| 62 | |
| 63 | export const makeTest = ( |
| 64 | fn: Circus.TestFn, |