-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathror_test.ts
More file actions
38 lines (34 loc) · 1004 Bytes
/
ror_test.ts
File metadata and controls
38 lines (34 loc) · 1004 Bytes
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
//
// Test our ROR methods
//
import { assertEquals, assertNotEquals } from "@std/assert";
import { normalizeROR, validateROR } from "./ror.ts";
import { verifyROR } from "./ror_record.ts";
Deno.test("tests varified ROR", async function () {
const varified_ids: string[] = [
"https://ror.org/05dxps055",
"https://ror.org/040ty4453",
"https://ror.org/03taz7m60",
"https://ror.org/05td03w87",
"https://ror.org/024e4df17",
];
for (const id of varified_ids) {
// Normalize
const normalized = normalizeROR(id);
assertNotEquals(normalized, undefined);
console.log(`Normalized ROR: ${normalized}`);
// Validate
assertEquals(validateROR(id), true);
// Verify is via ror.org
const isOK: boolean = await verifyROR(id);
assertEquals(isOK, true);
}
});
Deno.test("test caltech doi", function () {
const ror = "https://ror.org/05dxps055";
assertEquals(
validateROR(ror),
true,
`Caltech Library ROR should validate, ${ror}`,
);
});