-
Notifications
You must be signed in to change notification settings - Fork 3
/
bidsId.spec.js
30 lines (24 loc) · 910 Bytes
/
bidsId.spec.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
var assert = require('assert');
var bidsId = require('../../libs/bidsId');
describe('libs/bidsId.js', () => {
describe('hexToASCII()', () => {
it('should decode hex strings to ASCII', () => {
assert.equal(bidsId.hexToASCII('202020206473303030313437'), ' ds000147');
});
});
describe('hexFromASCII()', () => {
it('should encode ASCII strings to hex', () => {
assert.equal(bidsId.hexFromASCII(' ds000147'), '202020206473303030313437');
});
});
describe('decodeId()', () => {
it('should decode hex BIDS IDs to ASCII', () => {
assert.equal(bidsId.decodeId('202020206473303030313437'), 'ds000147');
});
});
describe('encodeId()', () => {
it('should encode BIDS IDs', () => {
assert.equal(bidsId.encodeId('ds000147'), '202020206473303030313437');
});
});
});