gristlabs_grist-core/test/common/timeFormat.js
Jarosław Sadziński a52d56f613 (core) Moving client and common tests to core
Summary:
- Moved /test/client and /test/common to core.
- Moved two files (CircularArray and RecentItems) from app/common to core/app/common.
- Moved resetOrg test to gen-server.
- `testrun.sh` is now invoking common and client test from core.
- Added missing packages to core's package.json (and revealed underscore as it is used in the main app).
- Removed Coord.js as it is not used anywhere.

Test Plan: Existing tests

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D3590
2022-08-23 19:20:10 +02:00

24 lines
648 B
JavaScript

/* global describe, it */
var assert = require('assert');
var {timeFormat} = require('app/common/timeFormat');
describe('timeFormat', function() {
var date = new Date(2014, 3, 4, 22, 28, 16, 123);
it("should format date", function() {
assert.equal(timeFormat("Y", date), "20140404");
assert.equal(timeFormat("D", date), "2014-04-04");
});
it("should format time", function() {
assert.equal(timeFormat("T", date), "22:28:16");
assert.equal(timeFormat("T + M", date), "22:28:16 + 123");
});
it("should format date and time", function() {
assert.equal(timeFormat("A", date), "2014-04-04 22:28:16.123");
});
});