// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import { assert } from 'chai';
import * as Platform from './platform.js';
describe('DateUtilities', () => {
    describe('isValid', () => {
        it('returns true for a valid date', () => {
            assert.isTrue(Platform.DateUtilities.isValid(new Date()));
        });
        it('returns false for a nonsense date', () => {
            const soNotADate = new Date('not-a-date');
            assert.isFalse(Platform.DateUtilities.isValid(soNotADate));
        });
    });
    describe('toISO8601Compact', () => {
        it('formats a date into a string', () => {
            const date = new Date(2020, 10, 20, 12, 13, 14);
            assert.strictEqual(Platform.DateUtilities.toISO8601Compact(date), '20201120T121314');
        });
        it('adds leading zeroes', () => {
            const date = new Date(2020, 0, 1, 0, 0, 0);
            assert.strictEqual(Platform.DateUtilities.toISO8601Compact(date), '20200101T000000');
        });
    });
});
//# sourceMappingURL=DateUtilities.test.js.map