-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add integration tests on datamart repository
- Loading branch information
1 parent
21bf049
commit 3f8619e
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
tests/integration/infrastructure/repositories/DatamartRepository_test.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
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 }); | ||
}); | ||
}); | ||
}); |