Files
directus/tests/get-dbs-to-test.ts
Jay Cammarano 8214fd1659 Add support for Postgres 10 in the end-to-end tests. (#10210)
* cant test mysql locally rn (m1 issue)

* Update tests/config.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-12-01 18:04:52 -05:00

25 lines
665 B
TypeScript

/** @TODO once Oracle is officially supported, enable it here */
export const allVendors = ['mssql', 'mysql', 'postgres', /* 'oracle', */ 'maria' /*, 'sqlite3'*/, 'postgres10'];
export function getDBsToTest(): string[] {
const testVendors = process.env.TEST_DB || '*';
let vendors = [];
if (testVendors === '*') {
vendors = allVendors;
} else if (testVendors.includes(',')) {
vendors = testVendors.split(',').map((v) => v.trim());
} else {
vendors = [testVendors];
}
for (const vendor of vendors) {
if (allVendors.includes(vendor) === false) {
throw new Error(`No e2e testing capabilities for vendor "${vendor}".`);
}
}
return vendors;
}