Skip to content

Commit

Permalink
switched test to use .toThrow
Browse files Browse the repository at this point in the history
  • Loading branch information
kwelch committed Feb 7, 2017
1 parent f9353f6 commit 4685ec6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/utils/__snapshots__/fuelSavingsCalculator.spec.js.snap

This file was deleted.

9 changes: 2 additions & 7 deletions src/utils/fuelSavingsCalculator.spec.js
Expand Up @@ -65,13 +65,8 @@ describe('Fuel Savings Calculator', () => {
// arrange
const milesPerYear = 1200;

try {
// act
calculator().calculateMilesDrivenPerMonth(milesPerYear, 'minute');
} catch (err) {
// assert
expect(err).toMatchSnapshot();
}
// act & assert
expect(() => calculator().calculateMilesDrivenPerMonth(milesPerYear, 'minute')).toThrow('Unknown milesDrivenTimeframe passed: minute');
});
});

Expand Down

0 comments on commit 4685ec6

Please sign in to comment.