slate-test-utils
Version:
> 📣 Love Slate and looking for your next gig? Sirona Medical is [hiring](https://sironamedical.com/about-us/careers/)!
37 lines (36 loc) • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.testRunner = void 0;
// @noflow
const jest_useragent_mock_1 = require("jest-useragent-mock");
const mocks_1 = require("./mocks");
const testRunner = (testCases, { runMac = true, runWindows = true } = {}) => {
if (runMac) {
describe('Mac', () => {
beforeAll(() => {
(0, jest_useragent_mock_1.mockUserAgent)('Mac OS X');
(0, mocks_1.mockPlatform)('Mac');
});
afterAll(() => {
(0, jest_useragent_mock_1.clear)();
(0, mocks_1.clear)();
});
testCases();
});
}
if (runWindows) {
describe('Windows', () => {
beforeAll(() => {
// Windows is !IS_APPLE under the hood for Slate
(0, jest_useragent_mock_1.mockUserAgent)('');
(0, mocks_1.mockPlatform)('');
});
afterAll(() => {
(0, jest_useragent_mock_1.clear)();
(0, mocks_1.clear)();
});
testCases();
});
}
};
exports.testRunner = testRunner;