-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from oslabs-beta/main
SeeQR V14.0 Launch
- Loading branch information
Showing
150 changed files
with
12,513 additions
and
11,349 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// import mysql from 'mysql2/promise'; | ||
import databaseConnections from '../../../../backend/src/db/databaseConnections'; | ||
const { PG_DBConnect, PG_DBDisconnect, MSQL_DBConnect, MSQL_DBQuery, RDS_PG_DBConnect, RDS_MSQL_DBConnect, RDS_MSQL_DBQuery, SQLite_DBConnect } = databaseConnections | ||
// import { PoolConfig } from 'pg'; | ||
|
||
|
||
|
||
|
||
describe('Database Connection Tests', () => { | ||
it('should fail to connect with invalid credentials', async () => { | ||
try { | ||
await PG_DBConnect('postgres://invalid:credentials@localhost/dbname', 'dbname'); | ||
} catch (error) { | ||
expect(error).toBeDefined(); | ||
} | ||
}); | ||
}); | ||
|
||
describe('MySQL', () => { | ||
const MYSQL_CREDS = { | ||
host: 'localhost', | ||
user: 'username', | ||
password: 'password', | ||
database: 'dbname', | ||
waitForConnections: true, | ||
connectionLimit: 10, | ||
queueLimit: 0, | ||
multipleStatements: true, | ||
}; | ||
|
||
it('should connect and perform a query successfully', async () => { | ||
await MSQL_DBConnect(MYSQL_CREDS); | ||
await MSQL_DBQuery('dbname'); | ||
}); | ||
|
||
it('should fail to connect with invalid credentials', async () => { | ||
const invalidCreds = {...MYSQL_CREDS, user: 'invalid', password: 'credentials' }; | ||
try { | ||
await MSQL_DBConnect(invalidCreds); | ||
} catch (error) { | ||
expect(error).toBeDefined(); | ||
} | ||
}); | ||
}); | ||
|
||
describe('SQLite', () => { | ||
it('should connect successfully', () => { | ||
SQLite_DBConnect(':memory:'); | ||
}); | ||
}); |
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 @@ | ||
// tests for mainmenu file |
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,2 @@ | ||
// test for config file | ||
|
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 @@ | ||
// tess for connection model file |
Oops, something went wrong.