import { ConcreteObserverA , ConcreteObserverB , ConcretePublisher , } from '../src/observer' ; test ( 'iterator.ts -> ConcretePublisher' , ( ) => { const publisher = new ConcretePublisher ( ) ; const observerA = new ConcreteObserverA ( ) ; publisher . attach ( observerA ) ; publisher . notify ( ) ; expect ( observerA . received ) . toEqual ( 1 ) ; const observerB = new ConcreteObserverB ( ) ; publisher . attach ( observerB ) ; publisher . notify ( ) ; expect ( observerA . received ) . toEqual ( 2 ) ; expect ( observerB . received ) . toEqual ( 1 ) ; } ) ;