Skip to content

Commit 2e71c76

Browse files
committed
Added TaxonomyManager test (stub)
1 parent 1929ef1 commit 2e71c76

File tree

2 files changed

+45
-26
lines changed

2 files changed

+45
-26
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Test taxonomy manager
3+
*/
4+
5+
//import * as fs from "fs";
6+
7+
// JS-YAML library
8+
//import * as yaml from "js-yaml";
9+
10+
import TaxonomyManager from "../js/managers/taxonomy.js";
11+
import Config from "../js/config.js";
12+
13+
describe("The TaxonomyManager", () => {
14+
it("should load an Odin taxonomy (yaml string)", () => {
15+
16+
// Pull the sample taxonomy file
17+
//const yamlData = fs.readFileSync("./src/__tests__/data/taxonomy.yml", "utf8");
18+
19+
const yamlData = `
20+
- Alias
21+
- ModificationTrigger
22+
- Site
23+
- Context:
24+
- Species
25+
- CellLine
26+
- Organ
27+
- CellType
28+
- Cellular_component
29+
- TissueType
30+
- ContextDirection
31+
- ContextLocation
32+
- ContextPossessive
33+
`
34+
const conf = new Config();
35+
36+
// Initialize TaxonomyManager and load data
37+
const taxman = new TaxonomyManager(conf);
38+
39+
taxman.loadTaxonomyYaml(yamlData);
40+
41+
const tree = taxman.getTaxonomyTree();
42+
43+
expect(tree[0]).toBe("Alias");
44+
});
45+
});

src/__tests__/ymljson.test.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)