This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('supertest'); | |
let server | |
describe('Test the root path', () => { | |
beforeEach(function () { | |
delete require.cache[require.resolve('../server')]; | |
server = require('../server'); | |
}); | |
afterEach((done) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express"; | |
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"; | |
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base"; | |
import { PrismaInstrumentation } from "@prisma/instrumentation"; | |
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions"; | |
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node"; | |
import { Resource } from "@opentelemetry/resources"; | |
import { JaegerExporter } from "@opentelemetry/exporter-jaeger"; | |
import { Logger } from "@api/services/LoggerService"; | |
import { registerInstrumentations } from "@opentelemetry/instrumentation"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DefaultSession } from "@auth/core/types"; | |
declare module "@auth/core" { | |
interface Session { | |
user: { | |
email: string; | |
subscribed: boolean; | |
// By default, TypeScript merges new interface properties and overwrite existing ones. In this case, the default session user properties will be overwritten, with the new one defined above. To keep the default session user properties, you need to add them back into the newly declared interface | |
} & DefaultSession["user"]; // To keep the default types | |
} |