ESLint: Auto reformat and fixing some warnings / errors.
This commit is contained in:
parent
5237db38e0
commit
91690509d3
50 changed files with 2141 additions and 1493 deletions
server/utils
|
@ -1,10 +1,10 @@
|
|||
import {parseTimestamp} from "./time";
|
||||
import { parseTimestamp } from "./time";
|
||||
import moment from "moment";
|
||||
|
||||
const TIMESTAMP_INVALID_STRING = "2020-01-02T42:99:23.000Z";
|
||||
const TIMESTAMP_VALID_STRING = "2020-01-02T12:34:56.000Z";
|
||||
|
||||
test('parseTimestamp() should fail parsing non-string timestamp', () => {
|
||||
test("parseTimestamp() should fail parsing non-string timestamp", () => {
|
||||
// given
|
||||
const timestamp = {};
|
||||
|
||||
|
@ -15,7 +15,7 @@ test('parseTimestamp() should fail parsing non-string timestamp', () => {
|
|||
expect(parsedTimestamp).toEqual(null);
|
||||
});
|
||||
|
||||
test('parseTimestamp() should fail parsing empty timestamp string', () => {
|
||||
test("parseTimestamp() should fail parsing empty timestamp string", () => {
|
||||
// given
|
||||
const timestamp = "";
|
||||
|
||||
|
@ -26,7 +26,7 @@ test('parseTimestamp() should fail parsing empty timestamp string', () => {
|
|||
expect(parsedTimestamp).toEqual(null);
|
||||
});
|
||||
|
||||
test('parseTimestamp() should fail parsing invalid timestamp string', () => {
|
||||
test("parseTimestamp() should fail parsing invalid timestamp string", () => {
|
||||
// given
|
||||
// noinspection UnnecessaryLocalVariableJS
|
||||
const timestamp = TIMESTAMP_INVALID_STRING;
|
||||
|
@ -38,7 +38,7 @@ test('parseTimestamp() should fail parsing invalid timestamp string', () => {
|
|||
expect(parsedTimestamp).toEqual(null);
|
||||
});
|
||||
|
||||
test('parseTimestamp() should succeed parsing valid timestamp string', () => {
|
||||
test("parseTimestamp() should succeed parsing valid timestamp string", () => {
|
||||
// given
|
||||
const timestamp = TIMESTAMP_VALID_STRING;
|
||||
|
||||
|
@ -47,7 +47,7 @@ test('parseTimestamp() should succeed parsing valid timestamp string', () => {
|
|||
|
||||
// then
|
||||
if (parsedTimestamp === null) {
|
||||
fail('timestamp should not be null');
|
||||
fail("timestamp should not be null");
|
||||
}
|
||||
expect(moment.unix(parsedTimestamp).toISOString()).toEqual(timestamp);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue