mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 20:39:28 +00:00
Add ability to insert test data with custom domain email addresses
This commit is contained in:
@@ -18,7 +18,7 @@ const { data, details } = require('./testData');
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
async function insertTestData() {
|
||||
async function insertTestData(customEmailDomain = false) {
|
||||
const conn = await new DatabaseConnectionPool();
|
||||
|
||||
// Run the creation statment for each table
|
||||
@@ -71,6 +71,12 @@ async function insertTestData() {
|
||||
|
||||
console.log(sql.trim());
|
||||
|
||||
if (customEmailDomain && dataToInsert.email) {
|
||||
const split = dataToInsert.email.split('@');
|
||||
split[1] = customEmailDomain;
|
||||
dataToInsert.email = split.join('@');
|
||||
}
|
||||
|
||||
try {
|
||||
await conn.runQuery(sql,
|
||||
Object.values(dataToInsert));
|
||||
|
||||
Reference in New Issue
Block a user