-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: lower case filename, and add canner adapter test case
- Loading branch information
1 parent
5d0b34d
commit ac69cbb
Showing
4 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
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
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
21 changes: 21 additions & 0 deletions
21
packages/extension-driver-canner/test/cannerAdapter.spec.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,21 @@ | ||
import { CannerServer } from './cannerServer'; | ||
import { CannerAdapter } from '../src/lib/cannerAdapter'; | ||
|
||
const pg = new CannerServer(); | ||
|
||
it('CannerAdapter should get urls without throw any error when connection and sql are valid', async () => { | ||
// Arrange | ||
const { connection } = pg.getProfile('profile1'); | ||
const adapter = new CannerAdapter(connection); | ||
// Act, Assert | ||
await expect( | ||
adapter.createAsyncQueryResultUrls('select 1') | ||
).resolves.not.toThrow(); | ||
}, 50000); | ||
it('CannerAdapter should throw when connection or sql are invalid', async () => { | ||
// Arrange | ||
const { connection } = pg.getProfile('profile1'); | ||
const adapter = new CannerAdapter(connection); | ||
// Act, Assert | ||
await expect(adapter.createAsyncQueryResultUrls('wrong')).rejects.toThrow(); // | ||
}, 50000); |
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