Skip to content

Instantly share code, notes, and snippets.

@dac09
Created October 7, 2014 23:03
Show Gist options
  • Save dac09/db750d648c8bad694907 to your computer and use it in GitHub Desktop.
Save dac09/db750d648c8bad694907 to your computer and use it in GitHub Desktop.
Constants in Jasmine unit tests
describe('Test', function() {
beforeEach(function() {
module('App', function($provide) {
$provide.constant('CSRF_TOKEN', 'MOCK_CONSTANT'); // <= mock your constant
});
});
// Tests go here
});
@fmquaglia
Copy link

@dac09 you saved my day dude 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment