Skip to main content
Glama

Convex MCP server

Official
by get-convex
event.ts3.43 kB
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import { assert } from "chai"; import { wrapInTests } from "./testHelpers"; import { query } from "../_generated/server"; export default query(async () => { return await wrapInTests({ eventInitializedWithType, eventInitializedWithTypeAndDict, eventComposedPathSuccess, eventStopPropagationSuccess, eventStopImmediatePropagationSuccess, eventPreventDefaultSuccess, eventInitializedWithNonStringType, eventIsTrusted, }); }); function eventInitializedWithType() { const type = "click"; const event = new Event(type); assert.strictEqual(event.isTrusted, false); assert.strictEqual(event.target, null); assert.strictEqual(event.currentTarget, null); assert.strictEqual(event.type, "click"); assert.strictEqual(event.bubbles, false); assert.strictEqual(event.cancelable, false); } function eventInitializedWithTypeAndDict() { const init = "submit"; const eventInit = { bubbles: true, cancelable: true } as EventInit; const event = new Event(init, eventInit); assert.strictEqual(event.isTrusted, false); assert.strictEqual(event.target, null); assert.strictEqual(event.currentTarget, null); assert.strictEqual(event.type, "submit"); assert.strictEqual(event.bubbles, true); assert.strictEqual(event.cancelable, true); } function eventComposedPathSuccess() { const type = "click"; const event = new Event(type); const composedPath = event.composedPath(); assert.deepEqual(composedPath, []); } function eventStopPropagationSuccess() { const type = "click"; const event = new Event(type); assert.strictEqual(event.cancelBubble, false); event.stopPropagation(); assert.strictEqual(event.cancelBubble, true); } function eventStopImmediatePropagationSuccess() { const type = "click"; const event = new Event(type); assert.strictEqual(event.cancelBubble, false); event.stopImmediatePropagation(); assert.strictEqual(event.cancelBubble, true); } function eventPreventDefaultSuccess() { const type = "click"; const event = new Event(type); assert.strictEqual(event.defaultPrevented, false); event.preventDefault(); assert.strictEqual(event.defaultPrevented, false); const eventInit = { bubbles: true, cancelable: true } as EventInit; const cancelableEvent = new Event(type, eventInit); assert.strictEqual(cancelableEvent.defaultPrevented, false); cancelableEvent.preventDefault(); assert.strictEqual(cancelableEvent.defaultPrevented, true); } function eventInitializedWithNonStringType() { // deno-lint-ignore no-explicit-any const type: any = undefined; const event = new Event(type); assert.strictEqual(event.isTrusted, false); assert.strictEqual(event.target, null); assert.strictEqual(event.currentTarget, null); assert.strictEqual(event.type, "undefined"); assert.strictEqual(event.bubbles, false); assert.strictEqual(event.cancelable, false); } // ref https://github.com/web-platform-tests/wpt/blob/master/dom/events/Event-isTrusted.any.js function eventIsTrusted() { const desc1 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted"); assert(desc1); assert.strictEqual(typeof desc1.get, "function"); const desc2 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted"); assert(desc2); assert.strictEqual(typeof desc2!.get, "function"); assert.strictEqual(desc1!.get, desc2!.get); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server