Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4066274
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
Aug 16 2026, 16:27 (11 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
33/17/fd51a47eccdf39f84996e592416e
Default Alt Text
deferUntilFrame.test.js (723 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment