Runtime-deprecate ospec, change change-log to changelog, fix a few assorted bugs (#2578)
This commit is contained in:
parent
1630b06106
commit
9f0dc2ab46
76 changed files with 484 additions and 410 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue