'Jest encountered an unexpected token '='

I created a test using a javascript enum as per this tutorial: https://www.sohamkamani.com/javascript/enums/

I tested it in standard javascript but i keep getting an error when using it in Jest: Jest encountered an unexpected token '='

 static test1 = new test("test1");
               ^

 SyntaxError: Unexpected token =

this is the enum i created:

     class test { 

       constructor(name) { 
          this.name = name;
        }

      static test1 = new test("test1")
      static test2 = new test("test2")
      static test3 = new test("test3")
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source