Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
super (async (bind, _, __, rebind) => {
bind(BUS_SQS_INTERNAL_SYMBOLS.SqsTransport)
.to(SqsTransport)
.inSingletonScope()
bindLogger(bind, SqsTransport)
rebind>(BUS_SYMBOLS.Transport)
.toDynamicValue(c => c.container.get(BUS_SQS_INTERNAL_SYMBOLS.SqsTransport))
bind(BUS_SQS_INTERNAL_SYMBOLS.Sqs)
.toConstantValue(new SQS())
bind(BUS_SQS_INTERNAL_SYMBOLS.Sns)
.toConstantValue(new SNS())
})
}
beforeAll(async () => {
container = new TestContainer()
container.bind(BUS_RABBITMQ_SYMBOLS.TransportConfiguration).toConstantValue(configuration)
bus = container.get(BUS_SYMBOLS.Bus)
sut = container.get(BUS_SYMBOLS.Transport)
bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)
bootstrap.registerHandler(TestCommandHandler)
const connectionFactory = container.get<() => Promise>(BUS_RABBITMQ_INTERNAL_SYMBOLS.AmqpFactory)
connection = await connectionFactory()
channel = await connection.createChannel()
await bootstrap.initialize(container)
})
beforeAll(async () => {
container = new TestContainer()
container.bind(BUS_SQS_SYMBOLS.SqsConfiguration).toConstantValue(sqsConfiguration)
sut = container.get(BUS_SYMBOLS.Transport)
sqs = container.get(BUS_SQS_INTERNAL_SYMBOLS.Sqs)
sns = container.get(BUS_SQS_INTERNAL_SYMBOLS.Sns)
bus = container.get(BUS_SYMBOLS.Bus)
bootstrap = container.get(BUS_SYMBOLS.ApplicationBootstrap)
handleChecker = Mock.ofType()
container.bind(HANDLE_CHECKER).toConstantValue(handleChecker.object)
bootstrap.registerHandler(TestCommandHandler)
})
super (async (bind, _, __, rebind) => {
bind(BUS_RABBITMQ_INTERNAL_SYMBOLS.RabbitMqTransport)
.to(RabbitMqTransport)
.inSingletonScope()
bindLogger(bind, RabbitMqTransport)
rebind>(BUS_SYMBOLS.Transport)
.to(RabbitMqTransport)
.inSingletonScope()
bind(BUS_RABBITMQ_INTERNAL_SYMBOLS.AmqpFactory)
.toFactory(c => async () => {
const configuration = c.container
.get(BUS_RABBITMQ_SYMBOLS.TransportConfiguration)
return connect(configuration.connectionString)
})
})
}