mirror of
https://github.com/hanzoai/jose.git
synced 2026-10-30 14:46:24 +00:00
29 lines
695 B
TypeScript
29 lines
695 B
TypeScript
import { t, Selector } from 'testcafe'
|
|
|
|
fixture('test suite').page('https://important-clam-66.deno.dev')
|
|
|
|
import * as fs from 'node:fs'
|
|
|
|
const script = fs.readFileSync('./tap/run-browser.js', { encoding: 'utf-8' })
|
|
|
|
const scriptTag = Selector('script')
|
|
|
|
test('passes tests', async (user) => {
|
|
await user.typeText('#js', script, { paste: true }).click('[type=submit]')
|
|
|
|
await scriptTag()
|
|
|
|
let stats
|
|
do {
|
|
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
stats = await t.eval(() => globalThis.stats)
|
|
} while (!stats)
|
|
|
|
const { log } = await t.getBrowserConsoleMessages()
|
|
for (const entry of log) {
|
|
console.log(entry)
|
|
}
|
|
|
|
await t.expect(stats?.failed).eql(0)
|
|
})
|