@@ -59,26 +59,34 @@ describe('TwoBucket', () => {
5959 } ) ;
6060
6161 describe ( 'Measure using bucket one of size 2 and bucket two of size 3' , ( ) => {
62- test . skip ( 'start with bucket one and end with bucket two' , ( ) => {
62+ xtest ( 'start with bucket one and end with bucket two' , ( ) => {
6363 const twoBucket = new TwoBucket ( 2 , 3 , 3 , 'one' ) ;
64- expect ( twoBucket . moves ( ) ) . toEqual ( 2 ) ;
64+ expect ( twoBucket . moves ( ) ) . toEqual ( 4 ) ;
6565 expect ( twoBucket . goalBucket ) . toEqual ( 'two' ) ;
66- expect ( twoBucket . otherBucket ) . toEqual ( 2 ) ;
66+ expect ( twoBucket . otherBucket ) . toEqual ( 1 ) ;
6767 } ) ;
6868 } ) ;
6969
7070 describe ( 'Reachability' , ( ) => {
7171 const buckOne = 6 ;
7272 const buckTwo = 15 ;
73- const starterBuck = 'one' ;
7473
75- test . skip ( 'Not possible to reach the goal' , ( ) => {
74+ xtest ( 'Not possible to reach the goal, start with bucket one' , ( ) => {
75+ const starterBuck = 'one' ;
76+ const goal = 5 ;
77+ const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck ) ;
78+ expect ( ( ) => twoBucket . moves ( ) ) . toThrow ( ) ;
79+ } ) ;
80+
81+ xtest ( 'Not possible to reach the goal, start with bucket two' , ( ) => {
82+ const starterBuck = 'two' ;
7683 const goal = 5 ;
7784 const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck ) ;
7885 expect ( ( ) => twoBucket . moves ( ) ) . toThrow ( ) ;
7986 } ) ;
8087
8188 xtest ( 'With the same buckets but a different goal, then it is possible' , ( ) => {
89+ const starterBuck = 'one' ;
8290 const goal = 9 ;
8391 const twoBucket = new TwoBucket ( buckOne , buckTwo , goal , starterBuck ) ;
8492 expect ( twoBucket . moves ( ) ) . toEqual ( 10 ) ;
@@ -88,7 +96,7 @@ describe('TwoBucket', () => {
8896 } ) ;
8997
9098 describe ( 'Goal larger than both buckets' , ( ) => {
91- test . skip ( 'Is impossible' , ( ) => {
99+ xtest ( 'Is impossible' , ( ) => {
92100 const twoBucket = new TwoBucket ( 5 , 7 , 8 , 'one' ) ;
93101 expect ( ( ) => twoBucket . moves ( ) ) . toThrow ( ) ;
94102 } ) ;
0 commit comments