Not able to execute test case in headless browser

I tried to execute one script and it passed in chrome but I did it in chrome headless, it didn’t pass. I tried with increasing window size, still no success. Please help on that.