Skip to content
This repository was archived by the owner on Apr 18, 2022. It is now read-only.

Commit c420374

Browse files
committed
Upgrade Deno and collections
1 parent 476fd7a commit c420374

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Mock
22

3-
[![version](https://img.shields.io/badge/release-v0.5.0-success)](https://github.com/udibo/mock/tree/v0.5.0)
4-
[![deno doc](https://img.shields.io/badge/deno-doc-success?logo=deno)](https://doc.deno.land/https/deno.land/x/[email protected].0/mod.ts)
5-
[![deno version](https://img.shields.io/badge/deno-v1.3.2-success?logo=deno)](https://github.com/denoland/deno/tree/v1.3.2)
3+
[![version](https://img.shields.io/badge/release-v0.5.1-success)](https://github.com/udibo/mock/tree/v0.5.1)
4+
[![deno doc](https://img.shields.io/badge/deno-doc-success?logo=deno)](https://doc.deno.land/https/deno.land/x/[email protected].1/mod.ts)
5+
[![deno version](https://img.shields.io/badge/deno-v1.3.3-success?logo=deno)](https://github.com/denoland/deno/tree/v1.3.3)
66
[![CI](https://github.com/udibo/mock/workflows/CI/badge.svg)](https://github.com/udibo/mock/actions?query=workflow%3ACI)
77
[![license](https://img.shields.io/github/license/udibo/mock)](https://github.com/udibo/mock/blob/master/LICENSE)
88

@@ -26,18 +26,18 @@ but can also be imported directly from GitHub using raw content URLs.
2626

2727
```ts
2828
// Import from Deno's third party module registry
29-
import { spy, Spy } from "https://deno.land/x/[email protected].0/mod.ts";
29+
import { spy, Spy } from "https://deno.land/x/[email protected].1/mod.ts";
3030
// Import from GitHub
31-
import { spy, Spy } "https://raw.githubusercontent.com/udibo/mock/v0.5.0/mod.ts";
31+
import { spy, Spy } "https://raw.githubusercontent.com/udibo/mock/v0.5.1/mod.ts";
3232
```
3333
3434
If you do not need all of the sub-modules, you can choose to just import the sub-modules you need.
3535
3636
```ts
3737
// Import from Deno's third party module registry
38-
import { spy, Spy } from "https://deno.land/x/[email protected].0/spy.ts";
38+
import { spy, Spy } from "https://deno.land/x/[email protected].1/spy.ts";
3939
// Import from GitHub
40-
import { spy, Spy } from "https://raw.githubusercontent.com/udibo/mock/v0.5.0/spy.ts";
40+
import { spy, Spy } from "https://raw.githubusercontent.com/udibo/mock/v0.5.1/spy.ts";
4141
```
4242

4343
#### Sub-modules
@@ -57,14 +57,14 @@ Node.js fully supports ES Modules.
5757
If a Node.js package has the type "module" specified in its package.json file, the JavaScript bundle can be imported as a `.js` file.
5858

5959
```js
60-
import { spy, Spy } from "./mock_v0.5.0.js";
60+
import { spy, Spy } from "./mock_v0.5.1.js";
6161
```
6262

6363
The default type for Node.js packages is "commonjs".
6464
To import the bundle into a commonjs package, the file extension of the JavaScript bundle must be changed from `.js` to `.mjs`.
6565

6666
```js
67-
import { spy, Spy } from "./mock_v0.5.0.mjs";
67+
import { spy, Spy } from "./mock_v0.5.1.mjs";
6868
```
6969

7070
See [Node.js Documentation](https://nodejs.org/api/esm.html) for more information.
@@ -82,15 +82,15 @@ Script tags for ES modules must have the type attribute set to "module".
8282

8383
```js
8484
// main.js
85-
import { spy, Spy } from "./mock_v0.5.0.js";
85+
import { spy, Spy } from "./mock_v0.5.1.js";
8686
```
8787

8888
You can also embed a module script directly into an HTML file by placing the JavaScript code
8989
within the body of the script tag.
9090

9191
```html
9292
<script type="module">
93-
import { spy, Spy } from "./mock_v0.5.0.js";
93+
import { spy, Spy } from "./mock_v0.5.1.js";
9494
</script>
9595
```
9696

@@ -100,7 +100,7 @@ See [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/
100100

101101
Below are some examples of how to use Spys, Stubs, and FakeTime in tests. When spying/stubing instance methods, you should wrap the calls and expectations with a try block then restore the function in a finally block to ensure the original instance method is restored before continuing to other tests. The same applies when using fake time.
102102

103-
See [deno docs](https://doc.deno.land/https/deno.land/x/[email protected].0/mod.ts) for more information.
103+
See [deno docs](https://doc.deno.land/https/deno.land/x/[email protected].1/mod.ts) for more information.
104104

105105
### Spy
106106

@@ -110,7 +110,7 @@ If you have a function that takes a callback but you don't need it to do anythin
110110

111111
```ts
112112
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
113-
import { spy, Spy } from "https://deno.land/x/[email protected].0/spy.ts";
113+
import { spy, Spy } from "https://deno.land/x/[email protected].1/spy.ts";
114114

115115
function add(
116116
a: number,
@@ -138,7 +138,7 @@ If you have a function that takes a callback that needs to still behave normally
138138

139139
```ts
140140
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
141-
import { spy, Spy } from "https://deno.land/x/[email protected].0/spy.ts";
141+
import { spy, Spy } from "https://deno.land/x/[email protected].1/spy.ts";
142142

143143
function filter<T>(values: T[], callback: (value: T) => boolean): any[] {
144144
return values.filter(callback);
@@ -166,7 +166,7 @@ If you have an instance method that needs to still behave normally, you can wrap
166166

167167
```ts
168168
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
169-
import { spy, Spy } from "https://deno.land/x/[email protected].0/spy.ts";
169+
import { spy, Spy } from "https://deno.land/x/[email protected].1/spy.ts";
170170

171171
class Database {
172172
private queries: any;
@@ -250,7 +250,7 @@ If you have an instance method but you don't need it to do or return anything, y
250250

251251
```ts
252252
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
253-
import { stub, Stub } from "https://deno.land/x/[email protected].0/stub.ts";
253+
import { stub, Stub } from "https://deno.land/x/[email protected].1/stub.ts";
254254

255255
class Cat {
256256
action(name: string): any {
@@ -284,7 +284,7 @@ If you have an instance method but need it to return specific values for each ca
284284

285285
```ts
286286
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
287-
import { stub, Stub } from "https://deno.land/x/[email protected].0/stub.ts";
287+
import { stub, Stub } from "https://deno.land/x/[email protected].1/stub.ts";
288288

289289
class Database {
290290
query(query: string, params: any[]): any[][] {
@@ -356,7 +356,7 @@ If you have an instance method but need it to call a replacement function instea
356356

357357
```ts
358358
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
359-
import { stub, Stub } from "https://deno.land/x/[email protected].0/stub.ts";
359+
import { stub, Stub } from "https://deno.land/x/[email protected].1/stub.ts";
360360

361361
class Database {
362362
query(query: string, params: any[]): any[][] {
@@ -432,8 +432,8 @@ controlled through the fake time instance.
432432

433433
```ts
434434
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
435-
import { spy, Spy } from "https://deno.land/x/[email protected].0/spy.ts";
436-
import { FakeTime } from "https://deno.land/x/[email protected].0/time.ts";
435+
import { spy, Spy } from "https://deno.land/x/[email protected].1/spy.ts";
436+
import { FakeTime } from "https://deno.land/x/[email protected].1/time.ts";
437437

438438
function secondInterval(cb: () => void): void {
439439
setInterval(cb, 1000);

deps/udibo/collections/comparators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { ascend } from "https://raw.githubusercontent.com/udibo/collections/v0.4.0/comparators.ts";
1+
export { ascend } from "https://deno.land/x/collections@v0.5.2/comparators.ts";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { RBTree } from "https://raw.githubusercontent.com/udibo/collections/v0.4.0/trees/rb_tree.ts";
1+
export { RBTree } from "https://deno.land/x/collections@v0.5.2/trees/rb_tree.ts";

deps/udibo/collections/vector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { Vector } from "https://raw.githubusercontent.com/udibo/collections/v0.4.0/vector.ts";
1+
export { Vector } from "https://deno.land/x/collections@v0.5.2/vector.ts";

0 commit comments

Comments
 (0)