Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Apr 22, 2024
1 parent 06115f7 commit 95fc7e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 10 additions & 8 deletions packages/happy-dom/src/nodes/document/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,16 +673,18 @@ export default class Document extends Node {
return QuerySelector.querySelector(this, selector);
}
/**
* Returns true if the command is supported.
* @deprecated
* @param command Command.
* @returns True if the command is supported, false otherwise.
*/
public queryCommandSupported(command: string): boolean {
* Returns true if the command is supported.
* @deprecated
* @param command Command.
* @returns True if the command is supported, false otherwise.
*/
public queryCommandSupported(command: string): boolean {
if (!command) {
throw new TypeError('Failed to execute \'queryCommandSupported\' on \'Document\': 1 argument required, but only 0 present.');
throw new TypeError(
"Failed to execute 'queryCommandSupported' on 'Document': 1 argument required, but only 0 present."
);
}
return true
return true;
}

/**
Expand Down
8 changes: 6 additions & 2 deletions packages/happy-dom/test/nodes/document/Document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,13 @@ describe('Document', () => {
});
it('Throws an error if the command is not passed.', () => {
// @ts-ignore - Intentionally testing without parameters.
expect(() => document.queryCommandSupported()).toThrowError(new TypeError('Failed to execute \'queryCommandSupported\' on \'Document\': 1 argument required, but only 0 present.'));
expect(() => document.queryCommandSupported()).toThrowError(
new TypeError(
"Failed to execute 'queryCommandSupported' on 'Document': 1 argument required, but only 0 present."
)
);
});
})
});

describe('getElementsByClassName()', () => {
it('Returns an elements by class name.', () => {
Expand Down

0 comments on commit 95fc7e8

Please sign in to comment.