Commit 1b780845 authored by Robert Knight's avatar Robert Knight

Fix a spurious code coverage miss

 - Ignore an unused function
 - Use a more modern idiom for setting the default value for a test
   seam
parent d4846a9d
...@@ -43,13 +43,7 @@ function delta(date, now) { ...@@ -43,13 +43,7 @@ function delta(date, now) {
* param is present for dependency injection during test. * param is present for dependency injection during test.
* @returns {string} * @returns {string}
*/ */
function formatIntl(date, options, Intl) { function formatIntl(date, options, Intl = window.Intl) {
// If the tests have passed in a mock Intl then use it, otherwise use the
// real one.
if (typeof Intl === 'undefined') {
Intl = window.Intl;
}
if (Intl && Intl.DateTimeFormat) { if (Intl && Intl.DateTimeFormat) {
const key = JSON.stringify(options); const key = JSON.stringify(options);
let formatter = formatters[key]; let formatter = formatters[key];
...@@ -144,7 +138,7 @@ const BREAKPOINTS = [ ...@@ -144,7 +138,7 @@ const BREAKPOINTS = [
/** @type {Breakpoint} */ /** @type {Breakpoint} */
const DEFAULT_BREAKPOINT = { const DEFAULT_BREAKPOINT = {
test: () => true, test: /* istanbul ignore next */ () => true,
formatFn: dayAndMonthAndYear, formatFn: dayAndMonthAndYear,
nextUpdate: null, nextUpdate: null,
}; };
......
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