TestUtils is a set of mocks and fakes in order to simplify unit testing for Power BI custom visuals
From version 2.3.0 testDom
function returns HTMLElement
instead of JQuery
object. If you are using JQuery in tests, wrap the testDom
calls with $(...)
for compatibility:
// 2.2.1 and below
let element: JQuery = testDom("100", "100");
// 2.3.0 and above
let element: JQuery = $(testDom("100", "100"));
The motivation is not to force JQuery usage. It might be not necessary in tests. In lots of cases element.get(0)
is the next operation after receiving an element with testDom
. Now JQuery is not required to use powerbi-visuals-utils-testutils, so you can drop this dependency. If you keep it, you can easily migrate your code to 2.3.* version using the example above.
- Read our contribution guideline to find out how to contribute bugs fixes and improvements
- Issue Tracker
- Development workflow
- How to build
- How to run unit tests locally
See the LICENSE file for license rights and limitations (MIT).