DEV Community

Discussion on: How to test classes with Jest

Collapse
 
jack75015 profile image
JackW • Edited

Hey
Very nice article :)

I guess there is a mistake in the test("defines a function" of . getRule and . validate:

Both have

    test("defines a function", () => {
      expect(typeof validator.setRule).toBe("function");
    });

Enter fullscreen mode Exit fullscreen mode

I think it should be typeof validator.getRule and typeof validator.validate

:) :)