1- import TwoBucket from './two-bucket' ;
1+ import { TwoBucket , Bucket } from './two-bucket'
22
33describe ( 'TwoBucket' , ( ) => {
44 describe ( 'works for input of 3, 5, 1' , ( ) => {
@@ -7,15 +7,15 @@ describe('TwoBucket', () => {
77 const goal = 1
88
99 test ( 'starting with bucket one' , ( ) => {
10- const starterBuck = 'one' ; // indicates which bucket to fill first
10+ const starterBuck = Bucket . One // indicates which bucket to fill first
1111 const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck )
1212 expect ( twoBucket . moves ( ) ) . toEqual ( 4 ) // includes the first fill
1313 expect ( twoBucket . goalBucket ) . toEqual ( 'one' ) // which bucket should end up with the desired # of liters
1414 expect ( twoBucket . otherBucket ) . toEqual ( 5 ) // leftover value in the "other" bucket once the goal has been reached
15- } ) ;
15+ } )
1616
1717 xtest ( 'starting with bucket two' , ( ) => {
18- const starterBuck = 'two'
18+ const starterBuck = Bucket . Two
1919 const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck )
2020 expect ( twoBucket . moves ( ) ) . toEqual ( 8 )
2121 expect ( twoBucket . goalBucket ) . toEqual ( 'two' )
@@ -29,15 +29,15 @@ describe('TwoBucket', () => {
2929 const goal = 2
3030
3131 xtest ( 'starting with bucket one' , ( ) => {
32- const starterBuck = 'one'
32+ const starterBuck = Bucket . One
3333 const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck )
3434 expect ( twoBucket . moves ( ) ) . toEqual ( 14 )
3535 expect ( twoBucket . goalBucket ) . toEqual ( 'one' )
3636 expect ( twoBucket . otherBucket ) . toEqual ( 11 )
3737 } )
3838
3939 xtest ( 'starting with bucket two' , ( ) => {
40- const starterBuck = 'two'
40+ const starterBuck = Bucket . Two
4141 const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck )
4242 expect ( twoBucket . moves ( ) ) . toEqual ( 18 )
4343 expect ( twoBucket . goalBucket ) . toEqual ( 'two' )
0 commit comments