- sessionName is now optional in open/exec; skips session restore when omitted - add selector param to open: returns outerHTML or textContent of matched element - extract session restore logic into private setupSession() to remove duplication - replace per-exception instanceof checks with single HttpException base class check - embed label into InternalServerErrorException message instead of logging separately - update MCP tool schemas and HTTP DTOs to reflect optional sessionName and new selector - add integration tests: sessionless open/exec, selector, selector+readerMode
16 lines
317 B
TypeScript
16 lines
317 B
TypeScript
const mockElement = {
|
|
outerHTML: '<div id="mock">mock content</div>',
|
|
textContent: 'mock content',
|
|
};
|
|
|
|
export class JSDOM {
|
|
constructor(public html: string, public options?: any) {}
|
|
get window() {
|
|
return {
|
|
document: {
|
|
querySelector: (_selector: string) => mockElement,
|
|
},
|
|
};
|
|
}
|
|
}
|