Runtime-deprecate ospec, change change-log to changelog, fix a few assorted bugs (#2578)

This commit is contained in:
Isiah Meadows 2020-09-29 13:27:07 -07:00 committed by GitHub
parent 1630b06106
commit 9f0dc2ab46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 484 additions and 410 deletions

View file

@ -1,7 +1,7 @@
"use strict"
// Low-priority TODO: remove the dependency on the renderer here.
var o = require("../../ospec/ospec")
var o = require("ospec")
var browserMock = require("../../test-utils/browserMock")
var throttleMocker = require("../../test-utils/throttleMock")
@ -26,14 +26,13 @@ o.spec("route", function() {
// Use precisely what `m.route` uses, for consistency and to ensure timings
// are aligned.
var waitFunc = typeof setImmediate === "function" ? setImmediate : setTimeout
function waitCycles(n) {
n = Math.max(n, 1)
return new Promise(function(resolve) {
return loop()
function loop() {
if (n === 0) resolve()
else { n--; waitFunc(loop) }
else { n--; setTimeout(loop, 4) }
}
})
}
@ -75,6 +74,8 @@ o.spec("route", function() {
o.beforeEach(function() {
currentTest = nextID++
$window = browserMock(env)
$window.setTimeout = setTimeout
// $window.setImmediate = setImmediate
throttleMock = throttleMocker()
root = $window.document.body