Skip to main content
Deno 2 is finally here 🎉️
Learn more
->
Dismiss
Products
Open Source
Deno
Modern runtime for JavaScript and TypeScript
Fresh
Web framework designed for the edge
JSR
TypeScript-first ESM package registry
Commercial
Deno for Enterprise
Enterprise support for runtime projects
Deploy
Easy serverless hosting for your JavaScript projects
Subhosting
Securely run untrusted code in a scalable sandbox
Docs
Modules
Standard Library
JSR
Node.js & npm
Current path
deno.land/x
Community
Discord
GitHub
X
YouTube
Mastodon
Blog
Search…
⌘K
Module
x
/
mock
/
test_deps.ts
Utilities to help mock behavior, spy on function calls, stub methods, and fake time for tests.
udibo/mock
Very Popular
Version
Latest
0.15.2
0.15.1
0.15.0
0.14.0
0.13.0
0.12.2
0.12.1
0.12.0
0.11.0
0.10.1
v0.10.0
v0.9.5
v0.9.4
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.0
v0.7.0
v0.6.1
v0.6.0
v0.5.1
v0.5.0
v0.4.0
v0.3.1
v0.3.0
v0.2.0
v0.1.0
Menu
mod.ts
(default module)
c
FakeTime
c
MockError
c
TimeError
I
ExpectedSpyCall
I
v
FakeDate
I
FakeDateConstructor
I
Spy
I
SpyCall
I
Stub
T
v
NativeDate
T
NativeDateConstructor
v
NativeTime
f
assertSpyCall
f
assertSpyCallArg
f
assertSpyCallArgs
f
assertSpyCallAsync
f
assertSpyCalls
f
mockSession
f
mockSessionAsync
f
resolvesNext
f
restore
f
returnsArg
f
returnsArgs
f
returnsNext
f
returnsThis
f
spy
f
stub
asserts.ts
I
ExpectedSpyCall
f
assertSpyCall
f
assertSpyCallArg
f
assertSpyCallArgs
f
assertSpyCallAsync
f
assertSpyCalls
callbacks.ts
f
resolvesNext
f
returnsArg
f
returnsArgs
f
returnsNext
f
returnsThis
deps.ts
c
AssertionError
f
assert
f
assertEquals
f
assertIsError
f
assertNotEquals
f
assertRejects
f
assertStrictEquals
f
assertThrows
mock.ts
c
MockError
I
Spy
I
SpyCall
I
Stub
f
mockSession
f
mockSessionAsync
f
restore
f
spy
f
stub
test_deps.ts
f
delay
test_shared.ts
c
Point
f
stringifyPoint
time_deps.ts
c
RBTree
I
DelayOptions
f
applyInstanceMixins
f
applyMixins
f
ascend
time.ts
c
FakeTime
c
TimeError
I
v
FakeDate
I
FakeDateConstructor
I
FakeTimeOptions
T
v
NativeDate
T
NativeDateConstructor
v
NativeTime
import
*
as
mock
from
"https://deno.land/x/mock@0.15.2/test_deps.ts"
;
Functions
f
delay