TypeError: Cannot read properties of undefined (reading 'bytesToUint')

I am unable to unittest a bytesToUint Function in my smart contract. Here’s my unit testing code. Please help!
here’s my unit testing code:


const DocumentToken = artifacts.require(“documentToken”);

require(‘chai’)

.use(require(‘chai-as-promised’))

.should()

contract(‘documentToken’,(accounts)=>{

let DocToken

before(async()=>{

    DocToken=await DocumentToken.deployed();

    console.log(DocToken);

 

})

describe('checking bytesToUint', async()=>{

 

  let b=new Uint8Array(12345);

   const uint= await DocToken.bytesToUint(b)

    it('matches uint',async=()=>{

        assert.equal(uint,12345)

       

    })

   

})

})

and here’s the error