Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Oct 10, 2024
1 parent 6426fd8 commit aadf460
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/unit/api/BackbeatAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ describe('BackbeatAPI', () => {

before(() => {
setupIngestionSiteMock();
});

beforeEach(() => {
const configCopy = JSON.parse(JSON.stringify(config));
bbapi = new BackbeatAPI(configCopy, fakeLogger, { timer: true });
bbapi = new BackbeatAPI(config, fakeLogger, { timer: true });
});

// valid routes
Expand Down Expand Up @@ -307,6 +303,11 @@ describe('BackbeatAPI', () => {
});

it('should setup internals when MongoDB configuration exists', done => {
bbapi._config.queuePopulator.mongo = {
host: 'localhost',
port: 27017,
db: 'backbeat',
};
bbapi.setupInternals(err => {
assert.ifError(err);
assert(setZookeeperStub.calledOnce);
Expand Down

0 comments on commit aadf460

Please sign in to comment.