unit or integration test for a npm script

I have a npm script that uses path, glob, path etc to output a bunch of code. How to test such script, or does the test even needed? in this one of the function that's used in that script

function getFiles() {
  let files = glob.sync('./src/ndex.js')
  let content = ''
  //do bunch of stuff
  return content