kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
eed94f42b4
commit
422f477cca
|
@ -9,7 +9,6 @@ DATABASE_URL=
|
||||||
|
|
||||||
SENTRY_DSN=
|
SENTRY_DSN=
|
||||||
|
|
||||||
STRIPE_PUBLISHABLE_KEY=
|
|
||||||
STRIPE_SECRET_KEY=
|
STRIPE_SECRET_KEY=
|
||||||
STRIPE_WEBHOOK_SECRET=
|
STRIPE_WEBHOOK_SECRET=
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const authRouter = issuer({
|
||||||
ttl: {
|
ttl: {
|
||||||
access: 60 * 60 * 24 * 30, // 30 days
|
access: 60 * 60 * 24 * 30, // 30 days
|
||||||
refresh: 60 * 60 * 24 * 365 // 1 year
|
refresh: 60 * 60 * 24 * 365 // 1 year
|
||||||
// Used for creating longer-lived testing tokens
|
// Used for creating longer-lived tokens for testing
|
||||||
// access: 60 * 60 * 24 * 366, // 1 year
|
// access: 60 * 60 * 24 * 366, // 1 year
|
||||||
// refresh: 60 * 60 * 24 * 365 * 5 // 5 years
|
// refresh: 60 * 60 * 24 * 365 * 5 // 5 years
|
||||||
},
|
},
|
||||||
|
@ -60,7 +60,6 @@ export const authRouter = issuer({
|
||||||
login_title: 'Welcome to Agentic'
|
login_title: 'Welcome to Agentic'
|
||||||
},
|
},
|
||||||
sendCode: async (email, code) => {
|
sendCode: async (email, code) => {
|
||||||
// TODO: Send email code to user
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('sending verify code email', { email, code })
|
console.log('sending verify code email', { email, code })
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,11 @@ const ky = defaultKy.extend({
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const [i, fixtureSuite] of fixtureSuites.entries()) {
|
for (const [i, fixtureSuite] of fixtureSuites.entries()) {
|
||||||
const { title, fixtures } = fixtureSuite
|
const { title, fixtures, compareResponseBodies = false } = fixtureSuite
|
||||||
|
|
||||||
const describeFn = fixtureSuite.only ? describe.only : describe
|
const describeFn = fixtureSuite.only ? describe.only : describe
|
||||||
describeFn(title, () => {
|
describeFn(title, () => {
|
||||||
let responseBody: any | undefined
|
let fixtureResponseBody: any | undefined
|
||||||
|
|
||||||
for (const [j, fixture] of fixtures.entries()) {
|
for (const [j, fixture] of fixtures.entries()) {
|
||||||
const method = fixture.request?.method ?? 'GET'
|
const method = fixture.request?.method ?? 'GET'
|
||||||
|
@ -86,11 +86,11 @@ for (const [i, fixtureSuite] of fixtureSuites.entries()) {
|
||||||
expect(body).toMatchSnapshot()
|
expect(body).toMatchSnapshot()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status >= 200 && status < 300) {
|
if (compareResponseBodies && status >= 200 && status < 300) {
|
||||||
if (!responseBody) {
|
if (!fixtureResponseBody) {
|
||||||
responseBody = body
|
fixtureResponseBody = body
|
||||||
} else {
|
} else {
|
||||||
expect(body).toEqual(responseBody)
|
expect(body).toEqual(fixtureResponseBody)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,15 @@ export type E2ETestFixtureSuite = {
|
||||||
|
|
||||||
/** @default false */
|
/** @default false */
|
||||||
sequential?: boolean
|
sequential?: boolean
|
||||||
|
|
||||||
|
/** @default false */
|
||||||
|
compareResponseBodies?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fixtureSuites: E2ETestFixtureSuite[] = [
|
export const fixtureSuites: E2ETestFixtureSuite[] = [
|
||||||
{
|
{
|
||||||
title: 'Basic OpenAPI getPost(1)',
|
title: 'Basic OpenAPI getPost(1)',
|
||||||
|
compareResponseBodies: true,
|
||||||
fixtures: [
|
fixtures: [
|
||||||
{
|
{
|
||||||
path: 'dev/test-basic-openapi/getPost',
|
path: 'dev/test-basic-openapi/getPost',
|
||||||
|
|
Ładowanie…
Reference in New Issue