Mock moving
This commit is contained in:
parent
dfcdcc296f
commit
0ac77cdb15
13 changed files with 219 additions and 528 deletions
|
@ -1,4 +1,5 @@
|
|||
import pg from "../postgres.js";
|
||||
import { failingMock } from "../mocks/results-mock.js";
|
||||
// Imports
|
||||
import {
|
||||
insertQuery,
|
||||
|
@ -10,36 +11,6 @@ import {
|
|||
const table = "test_results";
|
||||
const PG_DISABLED = process.env.POSTGRES_DISABLED;
|
||||
|
||||
const failingMock = () => {
|
||||
return [
|
||||
{
|
||||
name: "failing",
|
||||
class: "failing.js",
|
||||
timestamp: new Date().toJSON(),
|
||||
method: "FAKEMETHOD",
|
||||
cron: "1hour",
|
||||
type: "api",
|
||||
dailyFails: 12,
|
||||
screenshot: "https://picsum.photos/1920/1080",
|
||||
recentResults: [1, 0, 0, 1, 0],
|
||||
isPipeline: false,
|
||||
failedMessage: `Some Test FailureMessage`,
|
||||
},
|
||||
{
|
||||
name: "secondary1",
|
||||
class: "secondary1.js",
|
||||
timestamp: new Date().toJSON(),
|
||||
method: "FAKEMETHOD",
|
||||
cron: "1hour",
|
||||
type: "api",
|
||||
dailyFails: 1,
|
||||
screenshot: "https://picsum.photos/1920/1080",
|
||||
recentResults: [1, 0, 0, 1, 0],
|
||||
isPipeline: true,
|
||||
failedMessage: `Some Test FailureMessage from Secondary1`,
|
||||
},
|
||||
];
|
||||
};
|
||||
// Queries
|
||||
export const insertTestResult = (testResult) => {
|
||||
const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue