license import { Spec } from './spec.js' ; import { Fixturable , FixturedSpec } from './mixins/fixturable.js' ; import { Constructor } from './util.js' ; import '../../../chai/chai.js' ; const { expect } = ( self as any ) . chai ; export const describeSpecSpec = ( specToExtend , Spec ) => { const { describe , it , before } = specToExtend ; describe ( 'Spec' , ( ) => { describe ( 'with topics and tests' , ( ) => { before ( ( context ) => { const spec = new Spec ( ) ; const { describe , it } = spec ; describe ( 'a spec' , ( ) => { it ( 'has a test' , ( ) => { } ) ; describe ( 'nested topic' , ( ) => { it ( 'also has a test' , ( ) => { } ) ; it ( 'may have another test' , ( ) => { } ) ; } ) ; it ( 'may include trailing tests' , ( ) => { } ) ; } ) ; return { ... context , spec } ; } ) ; it ( 'counts the total tests in all topics' , ( { spec } ) => { expect ( spec . totalTestCount ) . to . be . equal ( 4 ) ; } ) ; } ) ; } ) ; } ; const spec = new ( Fixturable ( Spec ) ) ( ) ; describeSpecSpec ( spec , Spec ) ; export const specSpec = spec ;