@hello.nrfcloud.com/proto-map
Version:
Documents the communication protocol between devices, the hello.nrfcloud.com/map backend and web application
19 lines (18 loc) • 954 B
JavaScript
import assert from 'node:assert/strict';
import { describe, test as it } from 'node:test';
import { validate } from '../validate.js';
import { IsoDateType } from './IsoDateType.js';
void describe('isoDateRegExp', function() {
void it('should match a date string', function() {
var isoTs = new Date().toISOString();
var maybeValid = validate(IsoDateType())(isoTs);
assert.equal('errors' in maybeValid, false);
assert.equal('value' in maybeValid && (maybeValid === null || maybeValid === void 0 ? void 0 : maybeValid.value), isoTs);
});
void it('should validate a date string with local timezone', function() {
var isoTs = '2024-07-01T16:33:15+02:00';
var maybeValid = validate(IsoDateType())(isoTs);
assert.equal('errors' in maybeValid, false);
assert.equal('value' in maybeValid && (maybeValid === null || maybeValid === void 0 ? void 0 : maybeValid.value), isoTs);
});
});