Commit 2bbaf4c1 authored by Robert Knight's avatar Robert Knight

Move date, time & retry utility code to `util/` dir

As per #648, move several modules containing utility functions which
have no dependencies on other code to `src/sidebar/util`.
parent cf10d9f3
'use strict'; 'use strict';
var dateUtil = require('../date-util'); var dateUtil = require('../util/date');
// @ngInject // @ngInject
function TimestampController($scope, time) { function TimestampController($scope, time) {
......
...@@ -221,7 +221,7 @@ module.exports = angular.module('h', [ ...@@ -221,7 +221,7 @@ module.exports = angular.module('h', [
.value('raven', require('./raven')) .value('raven', require('./raven'))
.value('serviceConfig', serviceConfig) .value('serviceConfig', serviceConfig)
.value('settings', settings) .value('settings', settings)
.value('time', require('./time')) .value('time', require('./util/time'))
.value('urlEncodeFilter', require('./filter/url').encode) .value('urlEncodeFilter', require('./filter/url').encode)
.config(configureCompile) .config(configureCompile)
......
'use strict'; 'use strict';
var { retryPromiseOperation } = require('../retry-util'); var { retryPromiseOperation } = require('../util/retry');
/** /**
* A service which fetches and caches API route metadata. * A service which fetches and caches API route metadata.
......
'use strict'; 'use strict';
var events = require('../events'); var events = require('../events');
var retryUtil = require('../retry-util'); var retryUtil = require('../util/retry');
var CACHE_TTL = 5 * 60 * 1000; // 5 minutes var CACHE_TTL = 5 * 60 * 1000; // 5 minutes
......
'use strict'; 'use strict';
var retryUtil = require('../retry-util'); var retryUtil = require('../retry');
var toResult = require('../../shared/test/promise-util').toResult; var toResult = require('../../../shared/test/promise-util').toResult;
describe('retry-util', function () { describe('sidebar.util.retry', function () {
describe('.retryPromiseOperation', function () { describe('.retryPromiseOperation', function () {
it('should return the result of the operation function', function () { it('should return the result of the operation function', function () {
var operation = sinon.stub().returns(Promise.resolve(42)); var operation = sinon.stub().returns(Promise.resolve(42));
......
...@@ -38,7 +38,7 @@ var FIXTURES_NEXT_FUZZY_UPDATE = [ ...@@ -38,7 +38,7 @@ var FIXTURES_NEXT_FUZZY_UPDATE = [
[8 * year, null], [8 * year, null],
]; ];
describe('time', function () { describe('sidebar.util.time', function () {
var sandbox; var sandbox;
beforeEach(function () { beforeEach(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment