logo

Crowdly

Browser

Add to Chrome

Im File cypress.config.ts der Beispiel Implementierung von Cypres-Realworld-Ap...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Im File cypress.config.ts der Beispiel Implementierung von Cypres-Realworld-App findet sich folgende Konfiguration:

setupNodeEvents(on, config) {

const testDataApiEndpoint = `${config.env.apiUrl}/testData`;

const queryDatabase = ({ entity, query }, callback) => {

const fetchData = async (attrs) => {

const { data } = await axios.get(`${testDataApiEndpoint}/${entity}`);

return callback(data, attrs);

};

return Array.isArray(query) ? Promise.map(query, fetchData) : fetchData(query);

};

on("task", {

async "db:seed"() {

const { data } = await axios.post(`${testDataApiEndpoint}/seed`);

return data;

},

"filter:database"(queryPayload) {

return queryDatabase(queryPayload, (data, attrs) => _.filter(data.results, attrs));

},

"find:database"(queryPayload) {

return queryDatabase(queryPayload, (data, attrs) => _.find(data.results, attrs));

},

});

codeCoverageTask(on, config);

return config;

},

Welche Aussagen treffen hiermit zu?

More questions like this

Want instant access to all verified answers on elearning.tgm.ac.at?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome