license import { Spec } from '../spec.js' ; import { Suite } from '../suite.js' ; import { Isolatable } from './isolatable.js' ; import { Fixturable } from './fixturable.js' ; import { describeSpecSpec } from '../spec-spec.js' ; import '../../../../chai/chai.js' ; const IsolatableSpec = Isolatable ( Spec ) ; const spec = new ( Fixturable ( Spec ) ) ( ) ; const { expect } = ( self as any ) . chai ; const { describe , it , before } = spec ; describe ( 'Isolatable' , ( ) => { before ( ( context ) => ( { ... context , spec : new IsolatableSpec ( ) } ) ) ; describe ( 'with tests' , ( ) => { before ( ( context ) => { const { spec } = context ; const { describe , it } = spec ; const suite = new Suite ( [ spec ] ) ; describe ( 'isolated spec' , ( ) => { it ( 'has an isolated test' , ( ) => { } , { isolated : true } ) ; } ) ; return { ... context , spec , suite } ; } ) ; describe ( 'an isolated test' , ( ) => { it ( 'is marked as isolated' , ( { spec } ) => { const test = spec . rootTopic . tests [ 0 ] ; expect ( test . isolated ) . to . be . equal ( true ) ; } ) ; } ) ; } ) ; describeSpecSpec ( spec , IsolatableSpec ) ; } ) ; export const isolatableSpec = spec ;