gristlabs_grist-core/test/declarations.d.ts
Paul Fitzpatrick d6ab1f45c2 (core) move LinkingError and RawData tests
Summary:
Moves some more relevant tests to grist-core.
Small change to declarations that seemed necessary when
running buildtools/build_core.sh now, but I'm not sure
what changed. CI hasn't flagged anything, so smells like
the version of some package not nailed down.

Test Plan:
tried running tests in new location using
buildtools/build_core.sh

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3996
2023-08-09 09:46:36 -04:00

46 lines
1.6 KiB
TypeScript

declare module "test/nbrowser/gristUtil-nbrowser" {
// TODO - tsc can now do nice type inference for most of this, except $,
// so could change how export is done. Right now it leads to a mess because
// of $.
export declare let $: any;
export declare let gu: any;
export declare let server: any;
export declare let test: any;
}
// Adds missing type declaration to chai
declare namespace Chai {
interface AssertStatic {
notIncludeMembers<T>(superset: T[], subset: T[], message?: string): void;
}
}
declare module "selenium-webdriver" {
interface WebDriver {
withActions(cb: (actions: WebActions) => void): Promise<void>;
}
// This is not a complete definition of available methods, but only those that we use for now.
// TODO: find documentation for this interface or update selenium-webdriver.
interface WebActions {
contextClick(el?: WebElement): WebActions;
click(el?: WebElement): WebActions;
press(): WebActions;
move(params: {origin?: WebElement|string, x?: number, y?: number}): WebActions;
keyDown(key: string): WebActions;
keyUp(key: string): WebActions;
dragAndDrop(element: WebElement, target: WebElement): WebActions;
release(): WebActions;
doubleClick(element: WebElement): WebActions;
pause(ms: number): WebActions;
}
}
import "mocha-webdriver";
declare module "mocha-webdriver" {
// It looks like this hack makes tsc see our definition as primary, adding
// the typed version override (of the withActions method) as the default one.
export declare let driver: import("selenium-webdriver").WebDriver;
}