| Total Complexity | 4 |
| Complexity/F | 1 |
| Lines of Code | 22 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | |||
| 2 | var assert = require('assert'); |
||
| 3 | |||
| 4 | describe('from-bytes', function() { |
||
| 5 | |||
| 6 | let byteData = require('../../index.js'); |
||
| 7 | |||
| 8 | it('should turn bytes to a string', function() { |
||
| 9 | assert.deepEqual(byteData.fromBytes( |
||
| 10 | [97, 98], 8, {"base": 10, "char": true}), |
||
| 11 | "ab"); |
||
| 12 | }); |
||
| 13 | it('should turn hex bytes to a string', function() { |
||
| 14 | assert.deepEqual(byteData.fromBytes( |
||
| 15 | ["61", "62"], 8, {"base": 16, "char": true}), |
||
| 16 | "ab"); |
||
| 17 | }); |
||
| 18 | it('should turn bin bytes to a string', function() { |
||
| 19 | assert.deepEqual(byteData.fromBytes( |
||
| 20 | ["01100001", "01100010"], 8, {"base": 2, "char": true}), |
||
| 21 | "ab"); |
||
| 22 | }); |
||
| 23 | }); |
||
| 24 |