Skip to content

Commit

Permalink
chore: Add sinon types, fix some chai assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed May 2, 2024
1 parent 58cf15c commit c38e437
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 10 deletions.
47 changes: 41 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
"@types/chai": "^4.1.2",
"@types/mocha": "^5.0.0",
"@types/node": "^14.14.10",
"@types/sinon": "^9.0.11",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-transform-async-to-promises": "^0.8.15",
"babel-plugin-transform-rename-properties": "0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion test/browser/getDomSibling.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupScratch, teardown } from '../_util/helpers';
/** @jsx createElement */

describe('getDomSibling', () => {
/** @type {import('../../src/internal').PreactElement} */
/** @type {HTMLDivElement} */
let scratch;

const getRoot = dom => dom._children;
Expand Down
17 changes: 14 additions & 3 deletions test/extensions.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
declare module Chai {
export interface Assertion {
equalNode(node: Node | null, message?: string): void;
declare global {
namespace Chai {
interface Assertion {
equalNode(node: Node | null, message?: string): void;
called: Assertion;
calledOnce: Assertion;
calledTwice: Assertion;
calledWith(...args: any[]): Assertion;
calledWithMatch(...args: Record<string, unknown>[]): Assertion;
}
}
var expect: Chai.ExpectStatic;
var sinon: Sinon;
}

export {};

0 comments on commit c38e437

Please sign in to comment.