-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
34 lines (31 loc) · 1.03 KB
/
cypress.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { defineConfig } = require("cypress");
const { Client } = require("pg");
const dotenvOutput = require("dotenv").config({ path: ".env.development.local" });
const clientConfig = {
user: dotenvOutput.parsed.DATABASE_USERNAME,
password: dotenvOutput.parsed.DATABASE_PASSWORD,
host: dotenvOutput.parsed.DATABASE_HOST,
database: dotenvOutput.parsed.DATABASE_NAME,
ssl: false,
port: dotenvOutput.parsed.DATABASE_PORT
};
module.exports = defineConfig({
e2e: {
baseUrl: "http://localhost:3000",
setupNodeEvents(on, config) {
on("task", {
log(message) {
console.log(message);
return null;
},
async queryPG(query) {
const client = new Client(clientConfig);
await client.connect();
const res = await client.query(query);
await client.end();
return res.rows;
}
});
}
}
});