-
Notifications
You must be signed in to change notification settings - Fork 191
/
parsers-mol2.test.js
34 lines (26 loc) · 1.02 KB
/
parsers-mol2.test.js
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
/**
*@jest-environment jsdom
*/
global.$ = require("jquery");
global.URL.createObjectURL = function() {};
let $3Dmol = require("../../build/3Dmol.js");
const fs = require('fs');
const path = require('path');
describe('Function MOL2 | Input: multiple.mol2 |', ()=>{
const data = fs.readFileSync(path.resolve(__dirname,'../test_structs/multiple.mol2'), 'utf-8')
let atoms = $3Dmol.Parsers.MOL2(data, {});// cannot use multimodel
test("Atoms length is 1", ()=>{
expect(atoms.length).toBe(1);
});
test("Atoms should match the snapshot", ()=>{
expect(atoms).toMatchSnapshot();
});
});
// noH
describe('Function MOL2 | Input: multiple.mol2 | options: keepH |', ()=>{
const data = fs.readFileSync(path.resolve(__dirname,'../test_structs/multiple.mol2'), 'utf-8')
let atoms = $3Dmol.Parsers.MOL2(data, {keepH:false}); // noH = true
test("Atoms should match the snapshot (keepH: false)", ()=>{
expect(atoms).toMatchSnapshot();
});
});