PhantomJS unit tests failing because of HoT

Tags: #<Tag:0x00007efc6d57c810>

I’ve upgraded to handsontable 1.14.2 from 1.9.1 only now as the breaking changes meant a big chunk of refactoring, I finally had it working, but now when I run the unit tests with Karma + Jasmine, while they run fine in Chrome, they fail in PhantomJS as I get the following error:

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERRORes: WARN grunt-jsonmin@0.2.4 requires a peer of grunt@~0.4.1 but none was installed.
RangeError: Maximum call stack size exceeded.
at app/bower_components/handsontable/dist/handsontable.js:34468
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
RangeError: Maximum call stack size exceeded.
at app/bower_components/handsontable/dist/handsontable.js:34468

Any idea of what’s the cause of this?

I’ve also downgraded to version 1.14.0 and 1.14.1 but no differences

Hi @internal-support

Sorry, but I do not know what can be the cause and we do not support PhantomJS

Well, this is a problem, because anybody who uses a CI tool, need to use some sort of headless browser to run their unit tests, and not checking if your code works with them is a rather large issue.

Sorry, I left a misleading information. We use it but are planning to change it in the nearest future with a different solution. Our full-stack developer has seen your topic, however, it is hard to tell what can be the cause.

Well, once I’ve excluded handsontable and commented out the tests I include the Handsontable object from my test runner everything started to work again, so it’s clearly HoT, but the problem is that now I have to mock every single method of the Handsontable object if I want to have those tests back, which is not ideal…

I can truly understand. It sounds like a very long and monotonous process.

I do not know what we can do to help. Maybe if you could describe the details of your environment we would be able to get the same result.

The environment is rather complex, and we also use a lot of cells customisation and plugins.
One thing I’ve noticed is that the error comes from the handsontable package, and not the handsontable-pro, and the latter seems to have the first one as a dependency, so I guess the issue is not on the pro version but on the Community Edition one, if this can trim down the research.

Hi @internal-support

Did you try to delete node_modules, package-lock.json (and/or yarn lock file) and try to reinstall Handsontable?

We still use bower, but yeah, both bower_components and node_modules were deleted, twice, is one of the very first things I tried

Can you please try to load the /handsontable.full.js file? It looks like the line of error refers to an external dependency