Replit Commit

This commit is contained in:
Dunemask 2022-05-05 12:35:47 +00:00
commit f49f965a42
41 changed files with 32720 additions and 0 deletions

View file

@ -0,0 +1,51 @@
import pg from "../postgres.js";
// Imports
import {
insertQuery,
selectWhereAnyQuery,
updateWhereAnyQuery,
} from "../pg-query.js";
// Constants
const table = "test_results";
// Queries
export const insertTestResult = (testResult) => {
const {
test_name,
test_class,
test_method,
test_path,
test_type,
test_timestamp,
test_retry,
origin,
failed,
failed_message,
screenshot_url,
expected_screenshot_url,
weblog_url,
} = testResult;
var query = insertQuery(table, {
test_name,
test_class,
test_method,
test_path,
test_type,
test_timestamp,
test_retry,
origin,
failed,
failed_message,
screenshot_url,
expected_screenshot_url,
weblog_url,
});
query += "\n RETURNING *";
return pg.query(query);
};
export const getCurrentlyFailing = () => {
const query = "SELECT *";
return pg.query(query);
};