mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-14 03:49:55 +03:00
Refactor msp to modules (#3214)
* feat: refactor everything to modules * fix: a lot of circular deps fixes * feat: use vitest instead of karma
This commit is contained in:
parent
654dca2a19
commit
c086395def
82 changed files with 1660 additions and 1376 deletions
26
test/setup.js
Normal file
26
test/setup.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
import "bluebird";
|
||||
import { JSDOM } from "jsdom";
|
||||
import $ from "jquery";
|
||||
import { vi } from "vitest";
|
||||
import jBox from "jbox";
|
||||
|
||||
// Note: this can go away once jquery is used as module everywhere
|
||||
const { window } = new JSDOM("");
|
||||
$(window);
|
||||
globalThis.$ = $;
|
||||
globalThis.jQuery = $;
|
||||
globalThis.jBox = jBox;
|
||||
|
||||
Object.defineProperty(window, "matchMedia", {
|
||||
writable: true,
|
||||
value: vi.fn().mockImplementation((query) => ({
|
||||
matches: false,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addListener: vi.fn(), // deprecated
|
||||
removeListener: vi.fn(), // deprecated
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
})),
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue