'Jest, can I have different snapshots based on some condition?

I'm writing some test for my code using jest on node and I need to differentiate the snapshot based on the environment (Linux, Mac, Windows).

So what I would like to have would be something like

describe('test based on env', () => {
    test('test1', () => {
        expect(OS.getInfo()).toMatchSnapshot(); //snapshot should be different depending on the OS!!
    }
}

Is this possible at all?



Sources

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

Source: Stack Overflow

Solution Source