-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests format and add prepare option (#16)
Co-authored-by: Luc <[email protected]> Co-authored-by: Luc <[email protected]>
- Loading branch information
Showing
15 changed files
with
94 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ScylloClient } from '../lib'; | ||
|
||
type User = { | ||
username: string, | ||
uid: number | ||
} | ||
|
||
export default async () => { | ||
console.log('Preparing Database for Tests'); | ||
|
||
const DB = new ScylloClient<{ 'users': User }>({ | ||
client: { | ||
contactPoints: [ | ||
'localhost:9042' | ||
], | ||
localDataCenter: 'datacenter1', | ||
keyspace: 'system' | ||
} | ||
}); | ||
await DB.awaitConnection(); | ||
await DB.useKeyspace('scyllojestsuite', true); | ||
await DB.createTable('users', true, { | ||
username: { type: 'text' }, | ||
uid: { type: 'bigint' }, | ||
}, 'uid'); | ||
await DB.shutdown(); | ||
}; |
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,24 @@ | ||
import { ScylloClient } from '../lib'; | ||
|
||
type User = { | ||
username: string, | ||
uid: number | ||
} | ||
|
||
export default async () => { | ||
console.log('Cleaning Database after Tests'); | ||
|
||
const DB = new ScylloClient<{ 'users': User }>({ | ||
client: { | ||
contactPoints: [ | ||
'localhost:9042' | ||
], | ||
localDataCenter: 'datacenter1', | ||
keyspace: 'system' | ||
}, | ||
prepare: false | ||
}); | ||
await DB.awaitConnection(); | ||
await DB.raw('DROP KEYSPACE IF EXISTS scyllojestsuite'); | ||
await DB.shutdown(); | ||
}; |
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
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
2 changes: 1 addition & 1 deletion
2
__tests__/createIndexRaw.spec.ts → __tests__/raw/createIndexRaw.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
2 changes: 1 addition & 1 deletion
2
__tests__/createTableRaw.spec.ts → __tests__/raw/createTableRaw.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
2 changes: 1 addition & 1 deletion
2
__tests__/deleteFromRaw.spec.ts → __tests__/raw/deleteFromRaw.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
2 changes: 1 addition & 1 deletion
2
__tests__/insertIntoRaw.spec.ts → __tests__/raw/insertIntoRaw.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
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
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
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