Files
JavaScript/Conversions/test/BinaryToDecimal.test.js
Dhana D d5e309b605 merge: Add binary to decimal test file and convert function to es6 model. (#806)
* Added Hex to Binary conversion

* Add Binary to decimal test

* Fix Style
2021-10-23 23:16:13 +05:30

16 lines
480 B
JavaScript

import binaryToDecimal from '../BinaryToDecimal'
describe('BinaryToDecimal', () => {
it('expects to return correct decimal value', () => {
expect(binaryToDecimal('1000')).toBe(8)
})
it('expects to return correct hexadecimal value for more than one hex digit', () => {
expect(binaryToDecimal('01101000')).toBe(104)
})
it('expects to return correct hexadecimal value for padding-required binary', () => {
expect(binaryToDecimal('1000101')).toBe(69)
})
})