-
Notifications
You must be signed in to change notification settings - Fork 19
/
test_deps.ts
40 lines (32 loc) · 875 Bytes
/
test_deps.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { defaultAt, defaultVersion, RegistryUrl } from "./registry.ts";
import { DenoLand } from "./registry.ts";
export {
assert,
assertEquals,
assertThrows,
assertThrowsAsync,
} from "https://deno.land/[email protected]/testing/asserts.ts";
export class FakeRegistry implements RegistryUrl {
url: string;
constructor(url: string) {
this.url = url;
}
// deno-lint-ignore require-await
async all(): Promise<string[]> {
return ["0.0.2", "0.0.1"];
}
at(version: string): RegistryUrl {
const url = defaultAt(this, version);
return new FakeRegistry(url);
}
version(): string {
return defaultVersion(this);
}
regexp = /https?:\/\/fakeregistry.com\/[^\/\"\']*?\@[^\'\"]*/;
}
export class FakeDenoLand extends DenoLand {
// deno-lint-ignore require-await
async all(): Promise<string[]> {
return ["0.35.0", "0.34.0"];
}
}