Skip to content

Commit f4191b1

Browse files
committed
More pruning.
1 parent 78a9cae commit f4191b1

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

browser-extension/tests/lib/enhancers/github.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { EnhancerRegistry } from '../../../src/lib/registries'
77
import { PAGES } from '../../har-index'
88

99
vi.stubGlobal('defineContentScript', vi.fn())
10-
1110
vi.mock('../../../src/overtype/overtype', () => {
1211
const mockConstructor = vi.fn().mockImplementation(() => [
1312
{
@@ -28,17 +27,12 @@ vi.mock('../../../src/overtype/overtype', () => {
2827
})
2928

3029
const __dirname = path.dirname(fileURLToPath(import.meta.url))
31-
3230
async function loadHtmlFromHar(key: keyof typeof PAGES): Promise<string> {
3331
const url = PAGES[key]
3432
const harPath = path.join(__dirname, '../../har', `${key}.har`)
3533
const harContent = await fs.readFile(harPath, 'utf-8')
3634
const harData = JSON.parse(harContent)
37-
3835
const mainEntry = harData.log.entries.find((entry: any) => entry.request.url === url)
39-
if (!mainEntry) {
40-
throw new Error(`No HTML content found in HAR file: ${key}.har`)
41-
}
4236
return mainEntry.response.content.text
4337
}
4438

browser-extension/tests/setup.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,3 @@ Object.assign(globalThis, {
2828
Text: dom.Text,
2929
window: dom.window,
3030
})
31-
32-
// Mock querySelector methods properly
33-
const originalQuerySelector = dom.document.querySelector.bind(dom.document)
34-
const originalQuerySelectorAll = dom.document.querySelectorAll.bind(dom.document)
35-
36-
dom.document.querySelector = (selector: string) => {
37-
try {
38-
return originalQuerySelector(selector)
39-
} catch (_e) {
40-
return null
41-
}
42-
}
43-
44-
dom.document.querySelectorAll = ((selector: string) => {
45-
try {
46-
return originalQuerySelectorAll(selector)
47-
} catch (_e) {
48-
// Return an empty NodeList-like object instead of array
49-
const emptyNodeList = document.createDocumentFragment().childNodes
50-
return emptyNodeList as unknown as NodeListOf<Element>
51-
}
52-
}) as typeof dom.document.querySelectorAll

0 commit comments

Comments
 (0)