import { expect } from 'chai' ; import { Cave } from './cave.class' ; describe ( '2018 - Day 12 - Cave' , ( ) => { const inputs = [ '....#.#....' , '#.#' , '#.#.' , '.#.#' , '.#.#.' , '..#.#..' , '...#.#...' , '....#.#' , '#.#....' , '......#.#......' , '......#.#' , ] ; it ( 'Should be normalizing inputs on both ends:' , ( ) => { for ( const input of inputs ) { const cave = new Cave ( input ) ; cave . normalize ( ) ; expect ( cave . row . startsWith ( '....#' ) ) . to . be . true ; expect ( cave . row . endsWith ( '#....' ) ) . to . be . true ; } } ) ; it ( 'Should be a score of 325:' , ( ) => { const cave = new Cave ( '.#....##....#####...#######....#.#..##.' ) ; cave . offset = - 3 ; expect ( cave . score ( ) ) . to . equal ( 325 ) ; } ) ; } ) ;