Jest: TypeError: replaceAll is not a function

String.prototype.replaceAll() is a useful method and while building and executing everything works fine. However, all Jest-tests fail with the following error:

TypeError: replaceAll is not a function

These are my dependencies:

"dependencies": {
  "core-js": "^3.6.5",
  "vue": "^2.6.11",
  "vue-class-component": "^7.2.3",
  "vue-i18n": "^8.22.0",
  "vue-property-decorator": "^8.4.2",
  "vue-router": "^3.3.4",
  "vuex": "^3.5.1"
"devDependencies": {
  "@vue/test-utils": "^1.1.0",
  "jest-junit": "^12.0.0",
  "ts-jest": "^26.4.1",
  "typescript": "~3.9.3",
  "vue-jest": "^3.0.7",
  "vue-template-compiler": "^2.6.10"

How can I fix this behavior?

117 thoughts on “Jest: TypeError: replaceAll is not a function”

  1. Pingback: typical keto diet
  2. Excellent beat ! I would like to apprentice at the same
    time as you amend your website, how could i subscribe for
    a blog site? The account helped me a applicable deal.

    I had been a little bit familiar of this your broadcast offered
    bright transparent idea

  3. Hey, I think your site might be having browser compatibility
    issues. When I look at your blog site in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up!
    Other then that, terrific blog!

  4. I’ve been surfing online more than 3 hours
    these days, yet I by no means discovered any attention-grabbing article like yours.

    It is lovely worth enough for me. In my view, if all website owners
    and bloggers made just right content material as you probably did, the internet might be a lot more
    useful than ever before.

  5. That is really attention-grabbing, You are an overly professional blogger.
    I’ve joined your rss feed and look ahead to seeking extra of
    your wonderful post. Additionally, I have shared your
    site in my social networks

  6. Can I just say what a comfort to find an individual who actually
    understands what they’re discussing on the web.
    You definitely understand how to bring a problem to light and make it important.
    A lot more people have to look at this and understand this side of your story.
    I can’t believe you are not more popular since you most certainly
    possess the gift. cheap flights cheap flights


Leave a Comment