Skip to content

Commit

Permalink
Added secure connection to docker and secure test
Browse files Browse the repository at this point in the history
  • Loading branch information
bashleigh committed Sep 8, 2018
1 parent 87f4760 commit 049657f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ services:
image: rabbitmq:3-management
ports:
- 15672:15672
- 5672:5672
- 5672:5672
secure-rabbitmq:
image: rabbitmq:3-management
ports:
- 15673:15672
- 5673:5672
environment:
RABBITMQ_DEFAULT_PASS: pass
RABBITMQ_DEFAULT_USER: user
36 changes: 19 additions & 17 deletions src/__tests__/amqp.module.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,25 @@ describe('AmqpModule', () => {
amqpConnectionTest.close();
});

// it('Connection options', async () => {
// const module: TestingModule = await Test.createTestingModule({
// imports: [
// AmqpModule.forRoot({
// host: 'localhost',
// name: 'test',
// port: 5672,
// }),
// ],
// }).compile();

// const amqpConnectionTest = module.get(createConnectionToken('test'));

// expect(amqpConnectionTest).toBeInstanceOf(ChannelModel);

// amqpConnectionTest.close();
// });
it('Connection options', async () => {
const module: TestingModule = await Test.createTestingModule({
imports: [
AmqpModule.forRoot({
host: 'localhost',
name: 'test',
port: 5673,
username: 'user',
password: 'pass',
}),
],
}).compile();

const amqpConnectionTest = module.get(createConnectionToken('test'));

expect(amqpConnectionTest).toBeInstanceOf(ChannelModel);

amqpConnectionTest.close();
});

it('Connection available in submodule', async () => {

Expand Down

0 comments on commit 049657f

Please sign in to comment.