Skip to content

Commit 49bbf73

Browse files
author
Shane Osbourne
committed
prototype directly
1 parent d970deb commit 49bbf73

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/messaging/lib/test-utils.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,20 @@ export function wrapWindowsScripts(js, replacements) {
154154
delete window.chrome.webview.addEventListener;
155155
delete window.chrome.webview.removeEventListener;
156156
if (typeof Bluetooth === 'undefined') {
157-
globalThis.Bluetooth = { requestDevice: async () => { /* noop */ } }
157+
globalThis.Bluetooth.prototype = { requestDevice: async () => { /* noop */ } }
158158
}
159159
// @ts-expect-error - testing
160160
if (typeof USB === 'undefined') {
161-
globalThis.USB = { requestDevice: async () => { /* noop */ } }
161+
globalThis.USB.prototype = { requestDevice: async () => { /* noop */ } }
162162
}
163163
164164
// @ts-expect-error - testing
165165
if (typeof Serial === 'undefined') {
166-
globalThis.Serial = { requestPort: async () => { /* noop */ } }
166+
globalThis.Serial.prototype = { requestPort: async () => { /* noop */ } }
167167
}
168168
// @ts-expect-error - testing
169169
if (typeof HID === 'undefined') {
170-
globalThis.HID = { requestDevice: async () => { /* noop */ } }
170+
globalThis.HID.prototype = { requestDevice: async () => { /* noop */ } }
171171
}
172172
${js}
173173
} catch (e) {

0 commit comments

Comments
 (0)