mol_text_distance 0.0.977 → 0.0.979
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node.test.js +81 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -1592,7 +1592,7 @@ var $;
|
|
|
1592
1592
|
static last = [];
|
|
1593
1593
|
static send(next) {
|
|
1594
1594
|
$mol_wire_sync(this.first).push(next);
|
|
1595
|
-
|
|
1595
|
+
$$.$mol_wait_timeout(0);
|
|
1596
1596
|
this.last.push(next);
|
|
1597
1597
|
}
|
|
1598
1598
|
}
|
|
@@ -1601,15 +1601,15 @@ var $;
|
|
|
1601
1601
|
const promise = name('jin');
|
|
1602
1602
|
$.$mol_after_mock_warp();
|
|
1603
1603
|
await promise;
|
|
1604
|
-
$
|
|
1605
|
-
$
|
|
1604
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
1605
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
1606
1606
|
},
|
|
1607
1607
|
async 'Latest function calls wins'($) {
|
|
1608
1608
|
const first = [];
|
|
1609
1609
|
const last = [];
|
|
1610
1610
|
function send_name(next) {
|
|
1611
1611
|
$mol_wire_sync(first).push(next);
|
|
1612
|
-
|
|
1612
|
+
$$.$mol_wait_timeout(0);
|
|
1613
1613
|
last.push(next);
|
|
1614
1614
|
}
|
|
1615
1615
|
const name = $mol_wire_async(send_name);
|
|
@@ -1617,8 +1617,8 @@ var $;
|
|
|
1617
1617
|
const promise = name('jin');
|
|
1618
1618
|
$.$mol_after_mock_warp();
|
|
1619
1619
|
await promise;
|
|
1620
|
-
$
|
|
1621
|
-
$
|
|
1620
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
1621
|
+
$mol_assert_equal(last, ['jin']);
|
|
1622
1622
|
},
|
|
1623
1623
|
});
|
|
1624
1624
|
})($ || ($ = {}));
|
|
@@ -1763,6 +1763,68 @@ var $;
|
|
|
1763
1763
|
});
|
|
1764
1764
|
})($ || ($ = {}));
|
|
1765
1765
|
|
|
1766
|
+
;
|
|
1767
|
+
"use strict";
|
|
1768
|
+
var $;
|
|
1769
|
+
(function ($) {
|
|
1770
|
+
class $mol_after_work extends $mol_object2 {
|
|
1771
|
+
delay;
|
|
1772
|
+
task;
|
|
1773
|
+
id;
|
|
1774
|
+
constructor(delay, task) {
|
|
1775
|
+
super();
|
|
1776
|
+
this.delay = delay;
|
|
1777
|
+
this.task = task;
|
|
1778
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
1779
|
+
}
|
|
1780
|
+
destructor() {
|
|
1781
|
+
cancelIdleCallback(this.id);
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
$.$mol_after_work = $mol_after_work;
|
|
1785
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
1786
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
1787
|
+
}
|
|
1788
|
+
})($ || ($ = {}));
|
|
1789
|
+
|
|
1790
|
+
;
|
|
1791
|
+
"use strict";
|
|
1792
|
+
var $;
|
|
1793
|
+
(function ($_1) {
|
|
1794
|
+
$mol_test_mocks.push($ => {
|
|
1795
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
1796
|
+
});
|
|
1797
|
+
})($ || ($ = {}));
|
|
1798
|
+
|
|
1799
|
+
;
|
|
1800
|
+
"use strict";
|
|
1801
|
+
var $;
|
|
1802
|
+
(function ($) {
|
|
1803
|
+
function $mol_wait_rest_async() {
|
|
1804
|
+
return new Promise(done => {
|
|
1805
|
+
new this.$mol_after_work(16, () => done(null));
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
1809
|
+
function $mol_wait_rest() {
|
|
1810
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
1811
|
+
}
|
|
1812
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
1813
|
+
})($ || ($ = {}));
|
|
1814
|
+
|
|
1815
|
+
;
|
|
1816
|
+
"use strict";
|
|
1817
|
+
var $;
|
|
1818
|
+
(function ($_1) {
|
|
1819
|
+
var $$;
|
|
1820
|
+
(function ($$) {
|
|
1821
|
+
$mol_test_mocks.push($ => {
|
|
1822
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
1823
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
1824
|
+
});
|
|
1825
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1826
|
+
})($ || ($ = {}));
|
|
1827
|
+
|
|
1766
1828
|
;
|
|
1767
1829
|
"use strict";
|
|
1768
1830
|
var $;
|
|
@@ -1781,6 +1843,19 @@ var $;
|
|
|
1781
1843
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
1782
1844
|
})($ || ($ = {}));
|
|
1783
1845
|
|
|
1846
|
+
;
|
|
1847
|
+
"use strict";
|
|
1848
|
+
var $;
|
|
1849
|
+
(function ($_1) {
|
|
1850
|
+
var $$;
|
|
1851
|
+
(function ($$) {
|
|
1852
|
+
$mol_test_mocks.push($ => {
|
|
1853
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
1854
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
1855
|
+
});
|
|
1856
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1857
|
+
})($ || ($ = {}));
|
|
1858
|
+
|
|
1784
1859
|
;
|
|
1785
1860
|
"use strict";
|
|
1786
1861
|
var $;
|