Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1429146
deferUntilFrame.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
723 B
Referenced Files
None
Subscribers
None
deferUntilFrame.test.js
View Options
const
deferUntilFrame
=
require
(
'../../resources/skins.vector.js/deferUntilFrame.js'
);
describe
(
'deferUntilFrame.js'
,
()
=>
{
let
/** @type {jest.SpyInstance} */
spy
;
beforeEach
(
()
=>
{
spy
=
jest
.
spyOn
(
window
,
'requestAnimationFrame'
).
mockImplementation
(
(
cb
)
=>
{
setTimeout
(
()
=>
{
cb
(
1
);
}
);
return
1
;
}
);
}
);
afterEach
(
()
=>
{
spy
.
mockRestore
();
}
);
it
(
'does not fire rAF if `0` is passed'
,
(
done
)
=>
{
deferUntilFrame
(
()
=>
{
expect
(
spy
).
toHaveBeenCalledTimes
(
0
);
done
();
},
0
);
}
);
it
(
'fires rAF the specified number of times'
,
(
done
)
=>
{
deferUntilFrame
(
()
=>
{
expect
(
spy
).
toHaveBeenCalledTimes
(
3
);
done
();
},
3
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 17:09 (9 h, 43 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7d/64/5543cb7d58bc9ded0db9b874ff3e
Default Alt Text
deferUntilFrame.test.js (723 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment