Skip to content

Commit a72dd03

Browse files
committed
Flatten the corpus into one folder.
1 parent 66f3666 commit a72dd03

File tree

7 files changed

+4
-4
lines changed

7 files changed

+4
-4
lines changed

browser-extension/tests/corpus-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function loadRootHtmlStringFromHar(key: keyof typeof CORPUS): Promise<stri
5757
throw new Error(`Invalid HAR corpus key: ${String(key)}`)
5858
}
5959
const url = entry.url
60-
const harPath = path.join(__dirname, 'corpus', 'har', `${String(key)}.har`)
60+
const harPath = path.join(__dirname, 'corpus', `${String(key)}.har`)
6161
const harContent = await fs.readFile(harPath, 'utf-8')
6262
const harData: HarFile = JSON.parse(harContent)
6363
const mainEntry = harData.log.entries.find((entry) => entry.request.url === url)
@@ -72,7 +72,7 @@ async function loadHtmlStringFromHtml(key: keyof typeof CORPUS): Promise<string>
7272
if (!entry || entry.type !== 'html') {
7373
throw new Error(`Invalid HTML corpus key: ${String(key)}`)
7474
}
75-
const htmlPath = path.join(__dirname, 'corpus', 'html', `${String(key)}.html`)
75+
const htmlPath = path.join(__dirname, 'corpus', `${String(key)}.html`)
7676
return await fs.readFile(htmlPath, 'utf-8')
7777
}
7878

browser-extension/tests/corpus-view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async function loadHar(key: string): Promise<Har> {
104104
return harCache.get(key)!
105105
}
106106

107-
const harPath = path.join(__dirname, 'corpus', 'har', `${key}.har`)
107+
const harPath = path.join(__dirname, 'corpus', `${key}.har`)
108108
const harContent = await fs.readFile(harPath, 'utf-8')
109109
const harData = JSON.parse(harContent)
110110
harCache.set(key, harData)
@@ -248,7 +248,7 @@ app.get('/corpus/:key/:mode(clean|gitcasso)', async (req, res) => {
248248
return res.send(html)
249249
} else if (entry.type === 'html') {
250250
// Handle HTML corpus
251-
const htmlPath = path.join(__dirname, 'corpus', 'html', `${key}.html`)
251+
const htmlPath = path.join(__dirname, 'corpus', `${key}.html`)
252252
let html = await fs.readFile(htmlPath, 'utf-8')
253253

254254
// Strip CSP headers that might block our injected scripts

0 commit comments

Comments
 (0)