File tree Expand file tree Collapse file tree 2 files changed +45
-26
lines changed
Expand file tree Collapse file tree 2 files changed +45
-26
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments