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
// instrospection.ts | |
type UserTable = { | |
id: string, | |
email: string, | |
password: string | null, | |
active: boolean | |
} | |
// models.ts |
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
services: | |
kafka: | |
container_name: kafka | |
hostname: kafka | |
image: confluentinc/confluent-local:7.4.3 | |
ports: | |
- "8082:8082" | |
- "54106:54106" | |
- "9092:9092" | |
- "9997:9997" |
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 path from "path"; | |
import { DockerCompose } from "libs/docker-compose"; | |
import { isPortReachable } from "libs/is-port-reachable"; | |
import * as dockerCompose from "docker-compose"; | |
import knex from "knex"; | |
import { TestConfig } from "./global-config"; | |
module.exports = async () => { |
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 { Sleep } from "sleep"; | |
import IORedis from "ioredis"; | |
import pino from "pino"; | |
import { | |
LEADERSHIP_EVENTS, | |
LeadershipMetrics, | |
} from "libs/metrics/leadership"; | |
const leadershipKey = "leader"; |
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
describe('finally', () => { | |
it('1', () => { | |
const ttt = () => { | |
try { | |
return true | |
} finally { | |
// eslint-disable-next-line no-unsafe-finally | |
return false | |
} | |
} |
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
// #1 | |
class User { | |
public id: string | |
public password: string | |
public emails: Email[] | |
public deletedAt: Date | null | |
} | |
class Email { |
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
export const INTERNAL_ERROR_TYPE = "internal_error"; | |
export const INTERNAL_ERROR = { | |
type: INTERNAL_ERROR_TYPE, | |
message: "Internal error", | |
}; | |
export const CRITICAL_ERROR = { | |
type: "critical_error", | |
message: "Critical error", | |
}; |
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
var __importDefault = (this && this.__importDefault) || function (mod) { | |
return (mod && mod.__esModule) ? mod : { "default": mod }; | |
}; |
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 returnError = async <R>(callback: (...args: any) => Promise<R>): Promise<[R] | [undefined, Error]> => { | |
try { | |
return await callback() | |
} catch (e) { | |
return e | |
} | |
} | |
const [result, err] = returnError( | |
() => api.call(/* ... */) |
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 config = { | |
entities: [], | |
driverOptions: { | |
connection: { | |
ssl: { | |
require: true, | |
rejectUnauthorized: false, | |
}, | |
}, | |
}, |
NewerOlder