kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: add only param to e2e test fixtures
rodzic
7c527cb61b
commit
254ac40703
|
@ -18,7 +18,8 @@ const ky = defaultKy.extend({
|
|||
for (const [i, fixtureSuite] of fixtureSuites.entries()) {
|
||||
const { title, fixtures } = fixtureSuite
|
||||
|
||||
describe(title, () => {
|
||||
const describeFn = fixtureSuite.only ? describe.only : describe
|
||||
describeFn(title, () => {
|
||||
let responseBody: any | undefined
|
||||
|
||||
for (const [j, fixture] of fixtures.entries()) {
|
||||
|
@ -32,7 +33,8 @@ for (const [i, fixtureSuite] of fixtureSuites.entries()) {
|
|||
const { snapshot = status >= 200 && status < 300 } =
|
||||
fixture.response ?? {}
|
||||
|
||||
test(
|
||||
const testFn = fixture.only ? test.only.sequential : test.sequential
|
||||
testFn(
|
||||
`${i}.${j}: ${method} ${fixture.path}`,
|
||||
{
|
||||
timeout: fixture.timeout ?? 60_000
|
||||
|
|
|
@ -5,7 +5,7 @@ export type E2ETestFixture = {
|
|||
timeout?: number
|
||||
|
||||
/** @default false */
|
||||
// only?: boolean
|
||||
only?: boolean
|
||||
|
||||
request?: {
|
||||
/** @default 'GET' */
|
||||
|
@ -34,7 +34,7 @@ export type E2ETestFixtureSuite = {
|
|||
fixtures: E2ETestFixture[]
|
||||
|
||||
/** @default false */
|
||||
// only?: boolean
|
||||
only?: boolean
|
||||
}
|
||||
|
||||
export const fixtureSuites: E2ETestFixtureSuite[] = [
|
||||
|
|
|
@ -43,6 +43,7 @@ app.use(init)
|
|||
|
||||
// Wrangler does this for us. TODO: Does this happen on prod?
|
||||
// app.use(accessLogger)
|
||||
|
||||
app.use(responseTime)
|
||||
|
||||
app.all(async (ctx) => {
|
||||
|
|
Ładowanie…
Reference in New Issue