Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

preact

Jest expect.any() not working as expected

June 1, 2023 by Tarik

expect.toEqual checks for equality of state.active in your case. To achieve what you want, you have to make multiple expect statements: expect(state.active.active).toEqual(true) expect(state.active.data).toEqual(expect.any(Array)) expect(state.active.ID).toEqual(expect.any(String))

Categories reactjs Tags jestjs, preact, reactjs Leave a comment

Wrong components rendered by Preact

May 10, 2023 by Tarik

This is a classic issue that is totally underserved by Preact’s documentation, so I’d like to personally apologize for that! We’re always looking for help writing better documentation if anyone is interested. What has happened here is that you’re using the index of your Array as a key (in your map within render). This actually … Read more

Categories javascript Tags javascript, preact, reactjs Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa