Skip to content

Instantly share code, notes, and snippets.

module.exports = function() {
Cypress.Commands.add('sqlServer', (query) => {
if(!query) {
throw new Error('Query must be set');
}
cy.task('sqlServer:execute', query).then(response => {
let result = [];
const flatten = r => Array.isArray(r) && r.length === 1 ? flatten(r[0]) : r;
module.exports = function() {
Cypress.Commands.add('sqlServer', (query) => {
if(!query) {
throw new Error('Query must be set');
}
cy.task('sqlServer:execute', query).then(response => {
let result = [];
const flatten = r => Array.isArray(r) && r.length === 1 ? flatten(r[0]) : r;