Hi,
Im working with Scichart JS on a React project and trying to write some tests using Jest.
I managed to start a browser environment with webgl support to run the tests, but I’m having a hard time to provide the .data and .wasm files to this environment.
This is what i’m trying to run:
import {SciChartSurface} from 'scichart/Charting/Visuals/SciChartSurface';
const buildSurface = async () => {
const {sciChartSurface} = await SciChartSurface.create('test-surface', {
viewportBorder: {border: 1}
});
return {sciChartSurface};
};
it('should build a surface', async () => {
document.body.innerHTML = `<div id="test-surface"></div>`;
const response = await buildSurface();
const {sciChartSurface} = response;
});
and I’m getting lots of warns an errors like:
console.warn both async and sync fetching of the wasm failed
console.error Could not load SciChart WebAssembly module.
Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same version
console.error Error: Uncaught [Error: NetworkError for: scichart2d.data]
thrown: "Could not load SciChart WebAssembly module.
Check your build process and ensure that your scichart2d.wasm, scichart2d.data and scichart2d.js files are from the same version"
Does anyone know how to setup a sufficient environment on jest to successfully build a scichart surface?
- Lucas Lucafó asked 1 year ago
- last edited 1 year ago
- You must login to post comments
Hi Lucas,
Unfortunately right now it is now possible to run tests for SciChart.js in Node. But we are looking at ways to make this easier in near future. The testing is possible in tools like Puppeteer which use browser. Another option would be to mock SciChart.js library.
- Michael Klishevich answered 1 year ago
- You must login to post comments
Please login first to submit.