|
2 | 2 |
|
3 | 3 | [](https://github.com/udibo/mock/tree/v0.4.0)
|
4 | 4 | [](https://github.com/udibo/mock/actions?query=workflow%3ACI)
|
5 |
| -[](https://github.com/denoland/deno/tree/v1.2.3) |
| 5 | +[](https://github.com/denoland/deno/tree/v1.3.0) |
6 | 6 | [](https://doc.deno.land/https/deno.land/x/[email protected]/mod.ts)
|
7 | 7 | [](https://github.com/udibo/mock/blob/master/LICENSE)
|
8 | 8 |
|
@@ -109,7 +109,7 @@ When spying on a function or instance method, all arguments and return values ar
|
109 | 109 | If you have a function that takes a callback but you don't need it to do anything, you can create an empty spy. An empty spy will just return undefined for any calls made to it.
|
110 | 110 |
|
111 | 111 | ```ts
|
112 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 112 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
113 | 113 | import { spy, Spy } from "https://deno.land/x/[email protected]/spy.ts";
|
114 | 114 |
|
115 | 115 | function add(
|
@@ -137,7 +137,7 @@ Deno.test("calls fake callback", () => {
|
137 | 137 | If you have a function that takes a callback that needs to still behave normally, you can wrap it with a spy.
|
138 | 138 |
|
139 | 139 | ```ts
|
140 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 140 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
141 | 141 | import { spy, Spy } from "https://deno.land/x/[email protected]/spy.ts";
|
142 | 142 |
|
143 | 143 | function filter<T>(values: T[], callback: (value: T) => boolean): any[] {
|
@@ -165,7 +165,7 @@ Deno.test("calls real callback", () => {
|
165 | 165 | If you have an instance method that needs to still behave normally, you can wrap it with a spy. When you are done spying on a method, you need to call the restore function on the spy object to remove the wrapper from the instance method. If it is not restored and you attempt to wrap it again, it will throw a spy error saying "already spying on function".
|
166 | 166 |
|
167 | 167 | ```ts
|
168 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 168 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
169 | 169 | import { spy, Spy } from "https://deno.land/x/[email protected]/spy.ts";
|
170 | 170 |
|
171 | 171 | class Database {
|
@@ -249,7 +249,7 @@ When stubbing an instance method, all arguments and return values are recorded b
|
249 | 249 | If you have an instance method but you don't need it to do or return anything, you can create an empty stub. An empty stub will just return undefined for any calls made to it. If you need it to return specific values instead, you can add return values after initialization by replacing or adding to the `stub.returns` queue. When the returns queue is empty, it will return undefined.
|
250 | 250 |
|
251 | 251 | ```ts
|
252 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 252 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
253 | 253 | import { stub, Stub } from "https://deno.land/x/[email protected]/stub.ts";
|
254 | 254 |
|
255 | 255 | class Cat {
|
@@ -283,7 +283,7 @@ Deno.test("doAction", () => {
|
283 | 283 | If you have an instance method but need it to return specific values for each call, you can create a stub with an array of values in the order that you want them returned. You can add more return values after initialization by replacing or adding to the `stub.returns` queue.
|
284 | 284 |
|
285 | 285 | ```ts
|
286 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 286 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
287 | 287 | import { stub, Stub } from "https://deno.land/x/[email protected]/stub.ts";
|
288 | 288 |
|
289 | 289 | class Database {
|
@@ -355,7 +355,7 @@ Deno.test("getUsers", () => {
|
355 | 355 | If you have an instance method but need it to call a replacement function instead of the original, you can create a stub with a replacement function. If you need it to return specific values instead, you can add return values after initialization by replacing or adding to the `stub.returns` queue. When the returns queue is empty, it will call the replacement function.
|
356 | 356 |
|
357 | 357 | ```ts
|
358 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 358 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
359 | 359 | import { stub, Stub } from "https://deno.land/x/[email protected]/stub.ts";
|
360 | 360 |
|
361 | 361 | class Database {
|
@@ -431,7 +431,7 @@ Overrides the real Date object and timer functions with fake ones that can be
|
431 | 431 | controlled through the fake time instance.
|
432 | 432 |
|
433 | 433 | ```ts
|
434 |
| -import { assertEquals } from "https://deno.land/std@0.64.0/testing/asserts.ts"; |
| 434 | +import { assertEquals } from "https://deno.land/std@0.65.0/testing/asserts.ts"; |
435 | 435 | import { spy, Spy } from "https://deno.land/x/[email protected]/spy.ts";
|
436 | 436 | import { FakeTime } from "https://deno.land/x/[email protected]/time.ts";
|
437 | 437 |
|
|
0 commit comments