@egodigital/egoose
Version:
Helper classes and functions for Node.js 10 or later.
67 lines • 2.67 kB
JavaScript
;
/**
* This file is part of the @egodigital/egoose distribution.
* Copyright (c) e.GO Digital GmbH, Aachen, Germany (https://www.e-go-digital.com/)
*
* @egodigital/egoose is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, version 3.
*
* @egodigital/egoose is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const mocha_1 = require("mocha");
const moment = require("moment");
const index_1 = require("../index");
mocha_1.describe('#asUTC()', async function () {
mocha_1.describe('Date', function () {
mocha_1.it('utc => utc', async function () {
const NOW = Date.UTC(1979, 9, 5, 23, 9, 19, 79);
const AS_UTC = index_1.asUTC(NOW);
assert.ok(AS_UTC.isUTC());
assert.ok(AS_UTC.isUtc());
});
mocha_1.it('local => utc', async function () {
const NOW = new Date(1979, 9, 5, 23, 9, 19, 79);
const AS_UTC = index_1.asUTC(NOW);
assert.ok(AS_UTC.isUTC());
assert.ok(AS_UTC.isUtc());
});
});
mocha_1.describe('moment', function () {
mocha_1.it('utc => utc', async function () {
const NOW = moment.utc();
const AS_UTC = index_1.asUTC(NOW);
assert.ok(AS_UTC.isUTC());
assert.ok(AS_UTC.isUtc());
});
mocha_1.it('local => utc', async function () {
const NOW = moment();
const AS_UTC = index_1.asUTC(NOW);
assert.ok(AS_UTC.isUTC());
assert.ok(AS_UTC.isUtc());
});
});
mocha_1.describe('String', function () {
mocha_1.it('utc => utc', async function () {
const NOW = '1979-09-05 23:09:19.079';
const AS_UTC = index_1.asUTC(NOW);
assert.ok(AS_UTC.isUTC());
assert.ok(AS_UTC.isUtc());
});
mocha_1.it('local => utc', async function () {
const NOW = '1979-09-05 23:09:19.079';
const AS_UTC = index_1.asUTC(NOW);
assert.ok(AS_UTC.isUTC());
assert.ok(AS_UTC.isUtc());
});
});
});
//# sourceMappingURL=asUTC.js.map