I was trying to use this repository to create tests in my own custom visual that uses react. I tried to running the test command within this repo and it failed with the following error.
Can someone please assist?
FAIL tests/Visual.test.tsx
● Test suite failed to run
<local project path>\PowerBI-visuals-sampleBarChart-react\node_modules\powerbi-visuals-utils-colorutils\lib\index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { ColorHelper } from "./colorHelper";
^^^^^^
SyntaxError: Cannot use import statement outside a module
47 | import VisualObjectInstanceEnumerationObject = powerbi.VisualObjectInstanceEnumerationObject;
48 |
> 49 | import { ColorHelper } from "powerbi-visuals-utils-colorutils";
| ^
50 |
51 | import { VisualState, DataEntry } from "./dataInterfaces";
52 | import { LEGEND_HEIGHT } from "./constants";
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:471:17)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:513:25)
at Object.<anonymous> (src/visual.tsx:49:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 181.102s
Ran all test suites.
Hi Team,
I was trying to use this repository to create tests in my own custom visual that uses react. I tried to running the test command within this repo and it failed with the following error.
Can someone please assist?