You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps such a question has already been asked, but, unfortunately, I could not find it.
In general, I need help with the following:
We are developing in a monorepe on Angular and use your library @finos/perspective. We connected it through npm, but when writing tests, we encountered a problem that the perspective instance is not visible during the test pass, that is, it is undefined, the same problem was when starting the application. Then we connected the perspective-webpack-plugin package, created webpack.config and everything worked in the browser, but the problem remained in the tests.
Tell me, please, do not know what could be the problem or which way to look? (there was a hypothesis that we need to add the same plugin in jest.config, but I don’t know how yet)
The text was updated successfully, but these errors were encountered:
As of 0.4.0, @finos/perspective-webpack-plugin is optional. Without it, you will just get an "inline" version of perspective, with the WebAssembly payload base64 encoded as a string embedded Javascript, which is slow to load but otherwise identical to the plugin-enabled version.
.. perspective instance is not visible ..
.. leads me to believe you are including the package's umd/perspective.js script directly and relying on its global namespace symbol to call Perspective's API. If this is the case, use a module import instead, which will resolve correctly in Node/Jest and the browser:
I suspect for Jest specifically, this may be a struggle - Perspective's node.js and browser APIs are different, for starters, and the latter uses a laundry list of browser features that JSDom/Jest have nebulous support for (like Web Workers, Blob, ArrayBuffer, ..). You will get dramatically better results either mocking @finos/perspective-* modules, or using Puppeteer.
Support Question
Perhaps such a question has already been asked, but, unfortunately, I could not find it.
In general, I need help with the following:
We are developing in a monorepe on Angular and use your library
@finos/perspective
. We connected it throughnpm
, but when writing tests, we encountered a problem that the perspective instance is not visible during the test pass, that is, it is undefined, the same problem was when starting the application. Then we connected theperspective-webpack-plugin
package, createdwebpack.config
and everything worked in the browser, but the problem remained in the tests.Tell me, please, do not know what could be the problem or which way to look? (there was a hypothesis that we need to add the same plugin in
jest.config
, but I don’t know how yet)The text was updated successfully, but these errors were encountered: