• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MrSwitch / dare / #72

06 Jun 2026 07:58PM UTC coverage: 69.143% (-30.9%) from 100.0%
#72

push

web-flow
feat(import-engine): move engines out to their own import path, BREAKING CHANGE (#454)

* feat(postgres): move postgres out to it's own endpoint, BREAKING CHANGE

* style(prettier): fix

* style(ts): fix

* test: fixes

* docs: update README

* docs: update README

* fix(import): migrate LIKE keyword to configurable prop

* feat(import): define mysql5.7 (incl 5.6) legacy import paths, #455

* fix(import): test using wrong dependency

* feat: pluggable json formatter

* fix: issue

* chore: address comments

* fix: issue

* fix: address comments

* fix: address comments, tidy ts

* feat(import): abstract json perfix, operator and formatting

* chore: tidy

* fix(import): abstract DML changes

* feat(import): abstract applyAliasesOnUpdate

* feat(import): abstract sql_fulltext_wildcard

* feat(import): abstract sql_fulltext_wildcard

* feat(import): abstract fulltext sign operators

* chore(postgres): migrate to postgres16 for future proofing

* docs(README): add info about engine specific import paths

* Update README.md

* docs(README): update

* fix: address comments

* fix: prettier

339 of 499 branches covered (67.94%)

Branch coverage included in aggregate %.

487 of 516 new or added lines in 6 files covered. (94.38%)

1497 existing lines in 23 files now uncovered.

3439 of 4965 relevant lines covered (69.26%)

4.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

2.86
/src/utils/format_datetime.js
1
export default function formatDateTime(values) {
9✔
UNCOV
2
        if (typeof values === 'string') {
×
UNCOV
3
                if (values.indexOf('..') === -1) {
×
UNCOV
4
                        values = `${values}..${values}`;
×
UNCOV
5
                }
×
UNCOV
6

×
UNCOV
7
                let i = 0;
×
UNCOV
8

×
UNCOV
9
                // Out-of-scope cache for constructing correct format - CB
×
UNCOV
10
                let strCache = '';
×
UNCOV
11

×
UNCOV
12
                const a = values.split('..').map((str, index) => {
×
UNCOV
13
                        if (!str) {
×
UNCOV
14
                                return '';
×
UNCOV
15
                        }
×
UNCOV
16

×
UNCOV
17
                        // Pad the start of each subvalue - CB
×
UNCOV
18
                        const padded = str.split('-').map(el => el.padStart(2, '0'));
×
UNCOV
19
                        str = padded.join('-');
×
UNCOV
20

×
UNCOV
21
                        // Allow the format yyyy-mm-dd..dd by constructing the second timestamp - CB
×
UNCOV
22
                        if (
×
UNCOV
23
                                index === 1 &&
×
UNCOV
24
                                str.length === 2 &&
×
UNCOV
25
                                strCache.length &&
×
UNCOV
26
                                strCache.length === 10
×
UNCOV
27
                        ) {
×
UNCOV
28
                                str = strCache.slice(0, 8) + str;
×
UNCOV
29
                        }
×
UNCOV
30
                        strCache = str;
×
UNCOV
31

×
UNCOV
32
                        // Tidy up the ISO string
×
UNCOV
33

×
UNCOV
34
                        const _str = str.replace(/(?<hour>T\d+)$/, '$<hour>:00'); // Requires minutes with hours
×
UNCOV
35

×
UNCOV
36
                        const date = new Date(_str);
×
UNCOV
37

×
UNCOV
38
                        if (i++) {
×
UNCOV
39
                                const [, mm, dd, hh, i, s] = str.split(/\D+/);
×
UNCOV
40

×
UNCOV
41
                                if (!mm) {
×
UNCOV
42
                                        date.setFullYear(date.getFullYear() + 1);
×
UNCOV
43
                                } else if (!dd) {
×
UNCOV
44
                                        date.setMonth(date.getMonth() + 1);
×
UNCOV
45
                                } else if (!hh) {
×
UNCOV
46
                                        date.setDate(date.getDate() + 1);
×
UNCOV
47
                                } else if (!i) {
×
UNCOV
48
                                        date.setHours(date.getHours() + 1);
×
UNCOV
49
                                } else if (!s) {
×
UNCOV
50
                                        date.setMinutes(date.getMinutes() + 1);
×
UNCOV
51
                                }
×
UNCOV
52

×
UNCOV
53
                                // Wind back a second
×
UNCOV
54
                                if (!s) {
×
UNCOV
55
                                        date.setSeconds(date.getSeconds() - 1);
×
UNCOV
56
                                }
×
UNCOV
57
                        }
×
UNCOV
58

×
UNCOV
59
                        return date.toISOString().replace(/\.\d+Z/, '');
×
UNCOV
60
                });
×
UNCOV
61

×
UNCOV
62
                if (a[0] === a[1]) {
×
UNCOV
63
                        return a[0];
×
UNCOV
64
                }
×
UNCOV
65

×
UNCOV
66
                return a.join('..');
×
UNCOV
67
        }
×
UNCOV
68
        return values;
×
UNCOV
69
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc