1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
19 | const assert = require("assert");
|
20 | const mocha_1 = require("mocha");
|
21 | const moment = require("moment");
|
22 | const index_1 = require("../index");
|
23 | mocha_1.describe('#asUTC()', async function () {
|
24 | mocha_1.describe('Date', function () {
|
25 | mocha_1.it('utc => utc', async function () {
|
26 | const NOW = Date.UTC(1979, 9, 5, 23, 9, 19, 79);
|
27 | const AS_UTC = index_1.asUTC(NOW);
|
28 | assert.ok(AS_UTC.isUTC());
|
29 | assert.ok(AS_UTC.isUtc());
|
30 | });
|
31 | mocha_1.it('local => utc', async function () {
|
32 | const NOW = new Date(1979, 9, 5, 23, 9, 19, 79);
|
33 | const AS_UTC = index_1.asUTC(NOW);
|
34 | assert.ok(AS_UTC.isUTC());
|
35 | assert.ok(AS_UTC.isUtc());
|
36 | });
|
37 | });
|
38 | mocha_1.describe('moment', function () {
|
39 | mocha_1.it('utc => utc', async function () {
|
40 | const NOW = moment.utc();
|
41 | const AS_UTC = index_1.asUTC(NOW);
|
42 | assert.ok(AS_UTC.isUTC());
|
43 | assert.ok(AS_UTC.isUtc());
|
44 | });
|
45 | mocha_1.it('local => utc', async function () {
|
46 | const NOW = moment();
|
47 | const AS_UTC = index_1.asUTC(NOW);
|
48 | assert.ok(AS_UTC.isUTC());
|
49 | assert.ok(AS_UTC.isUtc());
|
50 | });
|
51 | });
|
52 | mocha_1.describe('String', function () {
|
53 | mocha_1.it('utc => utc', async function () {
|
54 | const NOW = '1979-09-05 23:09:19.079';
|
55 | const AS_UTC = index_1.asUTC(NOW);
|
56 | assert.ok(AS_UTC.isUTC());
|
57 | assert.ok(AS_UTC.isUtc());
|
58 | });
|
59 | mocha_1.it('local => utc', async function () {
|
60 | const NOW = '1979-09-05 23:09:19.079';
|
61 | const AS_UTC = index_1.asUTC(NOW);
|
62 | assert.ok(AS_UTC.isUTC());
|
63 | assert.ok(AS_UTC.isUtc());
|
64 | });
|
65 | });
|
66 | });
|
67 |
|
\ | No newline at end of file |