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('#asMoment()', async function () {
|
24 | mocha_1.describe('Date', function () {
|
25 | mocha_1.it('utc', async function () {
|
26 | const MOMENT_VAL = index_1.asMoment(Date.UTC(1979, 9, 5, 23, 9, 19, 79));
|
27 | assert.ok(moment.isMoment(MOMENT_VAL));
|
28 | assert.ok(MOMENT_VAL.isValid());
|
29 | });
|
30 | mocha_1.it('local', async function () {
|
31 | const MOMENT_VAL = index_1.asMoment(new Date(1979, 9, 5, 23, 9, 19, 79));
|
32 | assert.ok(moment.isMoment(MOMENT_VAL));
|
33 | assert.ok(MOMENT_VAL.isValid());
|
34 | });
|
35 | });
|
36 | mocha_1.describe('moment', function () {
|
37 | mocha_1.it('utc', async function () {
|
38 | const MOMENT_VAL = index_1.asMoment(moment.utc());
|
39 | assert.ok(moment.isMoment(MOMENT_VAL));
|
40 | assert.ok(MOMENT_VAL.isValid());
|
41 | });
|
42 | mocha_1.it('local', async function () {
|
43 | const MOMENT_VAL = index_1.asMoment(moment());
|
44 | assert.ok(moment.isMoment(MOMENT_VAL));
|
45 | assert.ok(MOMENT_VAL.isValid());
|
46 | });
|
47 | });
|
48 | mocha_1.describe('String', function () {
|
49 | mocha_1.it('local', async function () {
|
50 | const MOMENT_VAL = index_1.asMoment('1979-09-05 23:09:19.079');
|
51 | assert.ok(moment.isMoment(MOMENT_VAL));
|
52 | assert.ok(MOMENT_VAL.isValid());
|
53 | });
|
54 | });
|
55 | });
|
56 |
|
\ | No newline at end of file |