Skip to content

Commit

Permalink
test: add integration tests on datamart repository
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentHardouin authored Dec 16, 2024
1 parent 21bf049 commit 3f8619e
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { DatamartQueryModel } from '../../../../lib/domain/models/DatamartQuery.js';
import { datamartRepository } from '../../../../lib/infrastructure/DatamartRepository.js';
import { expect } from '../../../test-helper.js';

describe('Integration | Repository | DatamartRepository', function () {
describe('#find', function () {
it('should execute given DatamartQueryModel', async function () {
// given
const datamartQuery = new DatamartQueryModel({ query: 'SELECT 1=1 as foo;', paramValues: [], paramDefinitions: [] });

// when
const { result: stream } = datamartRepository.find(datamartQuery);

// then
let result;
for await (const chunk of stream) {
result = chunk;
}

expect(result).to.deep.equal({ foo: true });
});
});
});

0 comments on commit 3f8619e

Please sign in to comment.