jest test to ensure that a value is in an ENUM

Viewed 12

This is my first time working with jest. I have a scenario where I want to see if the selected value is in an ENUM or not. Here is my test case:

    test('Should be valid', () => {
        expect(TestCasesExport.userAccStatus(ACC_STATUS.LIVE)).toContain(MEM_STATUS);
    });

MEM_STATUS is an enum and ACC_STATUS is another enum that has some common values with MEM_STATUS.

When I run this test the received is 'live' and expected was an object i.e. {"LIVE": "live", ...}.

So, what do I change in my test case so that I can ensure that the recieved value is present in the enum MEM_STATUS?

0 Answers
Related