import { ConcreteProductA , ConcreteProductB , ConcreteCreatorA , ConcreteCreatorB , } from '../src/factory-method' ; test ( 'factory-method.ts -> ConcreteProductA' , ( ) => { const creator = new ConcreteCreatorA ( ) ; expect ( creator . factoryMethod ( ) ) . toBeInstanceOf ( ConcreteProductA ) ; expect ( creator . operation ( ) ) . toEqual ( 'ConcreteProductA' ) ; } ) ; test ( 'factory-method.ts -> ConcreteProductB' , ( ) => { const creator = new ConcreteCreatorB ( ) ; expect ( creator . factoryMethod ( ) ) . toBeInstanceOf ( ConcreteProductB ) ; expect ( creator . operation ( ) ) . toEqual ( 'ConcreteProductB' ) ; } ) ;