1.0.6 • Published 12 months ago

vitest-matchmedia-mock v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Vitest MatchMediaMock

codecov

how to import:

import MatchMediaMock from 'vitest-matchmedia-mock`

Usage example

describe('your test', () => {
  let matchMediaMock = new MatchMediaMock();
  afterAll(() => {
    matchMediaMock.clear();
  });
});

Use Media Query

describe('your test', () => {
  let matchMediaMock = new MatchMediaMock();
  beforeAll(() => {
    matchMediaMock.useMediaQuery('(prefers-color-scheme: dark)');
  });

  afterEach(() => {
    matchMediaMock.clear();
  });

  afterAll(() => {
    matchMediaMock.destroy();
  });
});
1.0.6

12 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago