Unverified Commit 0cebaa1a authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Move all files to .ts (6/6) (#85641)

parent 089ca2c0
...@@ -24,7 +24,7 @@ describe('TypeScript HMR', () => { ...@@ -24,7 +24,7 @@ describe('TypeScript HMR', () => {
// Events can be finicky in CI. This switches to a more reliable // Events can be finicky in CI. This switches to a more reliable
// polling method. // polling method.
CHOKIDAR_USEPOLLING: 'true', CHOKIDAR_USEPOLLING: 'true',
CHOKIDAR_INTERVAL: 500, CHOKIDAR_INTERVAL: '500',
}, },
}) })
}) })
...@@ -102,18 +102,10 @@ describe('TypeScript HMR', () => { ...@@ -102,18 +102,10 @@ describe('TypeScript HMR', () => {
await new Promise((resolve) => setTimeout(resolve, 500)) await new Promise((resolve) => setTimeout(resolve, 500))
} }
await fs.writeFile(pagePath, errContent) await fs.writeFile(pagePath, errContent)
const res = await check( await check(async () => {
async () => { const html = await browser.eval('document.querySelector("p").innerText')
const html = await browser.eval(
'document.querySelector("p").innerText'
)
return html.match(/hello with error/) ? 'success' : 'fail' return html.match(/hello with error/) ? 'success' : 'fail'
}, }, /success/)
/success/,
false
)
expect(res).toBe(true)
} finally { } finally {
if (browser) browser.close() if (browser) browser.close()
await fs.writeFile(pagePath, origContent) await fs.writeFile(pagePath, origContent)
......
...@@ -16,7 +16,7 @@ const appDir = join(__dirname, '..') ...@@ -16,7 +16,7 @@ const appDir = join(__dirname, '..')
let appPort let appPort
let app let app
async function get$(path, query) { async function get$(path, query?: any) {
const html = await renderViaHTTP(appPort, path, query) const html = await renderViaHTTP(appPort, path, query)
return cheerio.load(html) return cheerio.load(html)
} }
......
...@@ -8,7 +8,7 @@ const appDir = join(__dirname, '..') ...@@ -8,7 +8,7 @@ const appDir = join(__dirname, '..')
let appPort let appPort
let app let app
async function get$(path, query) { async function get$(path, query?: any) {
const html = await renderViaHTTP(appPort, path, query) const html = await renderViaHTTP(appPort, path, query)
return cheerio.load(html) return cheerio.load(html)
} }
......
...@@ -27,5 +27,6 @@ ...@@ -27,5 +27,6 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true "isolatedModules": true
} },
"exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
} }
...@@ -31,9 +31,6 @@ const expectedErr = ...@@ -31,9 +31,6 @@ const expectedErr =
onStderr(msg) { onStderr(msg) {
output += msg || '' output += msg || ''
}, },
ontStdout(msg) {
output += msg || ''
},
}) })
expect(output).toMatch(expectedErr) expect(output).toMatch(expectedErr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment