mirror of
https://codeberg.org/beerbrawl/beerbrawl.git
synced 2024-09-22 21:20:52 +02:00
chore(#136): e2e: fix coverage reporting
Signed-off-by: Christoph Heiss <e11907069@student.tuwien.ac.at>
This commit is contained in:
parent
9710a2d52f
commit
3552218e4a
|
@ -58,6 +58,7 @@ test-and-build-frontend:
|
|||
- npm run test:ci
|
||||
- npm run build
|
||||
- npm run openapi-clients:replace-base-path-for-prod
|
||||
coverage: /^Statements\s*:\s*([^%]+)/
|
||||
artifacts:
|
||||
paths:
|
||||
- frontend/dist
|
||||
|
@ -76,8 +77,9 @@ e2e-test:
|
|||
- sleep 30
|
||||
- cd ../e2e
|
||||
- npm ci
|
||||
- npm run cypress
|
||||
- npm run cypress:ci
|
||||
- npm run coverage:ci
|
||||
coverage: /^Statements\s*:\s*([^%]+)/
|
||||
artifacts:
|
||||
when: always
|
||||
expire_in: 1 hour
|
||||
|
|
21
e2e/cypress.config.ci.js
Normal file
21
e2e/cypress.config.ci.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
const { defineConfig } = require('cypress');
|
||||
|
||||
module.exports = defineConfig({
|
||||
reporter: 'cypress-multi-reporters',
|
||||
reporterOptions: {
|
||||
configFile: 'cypress/reporter-config.json',
|
||||
},
|
||||
watchForFileChanges: false,
|
||||
viewportWidth: 1920,
|
||||
viewportHeight: 1080,
|
||||
e2e: {
|
||||
specPattern: 'instrumented/e2e/**/*.cy.{js,jsx,ts,tsx}',
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
require('@cypress/code-coverage/task')(on, config);
|
||||
return config;
|
||||
},
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
},
|
||||
});
|
|
@ -13,7 +13,6 @@ module.exports = defineConfig({
|
|||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
require('@cypress/code-coverage/task')(on, config);
|
||||
require('./cypress/plugins/index.js')(on, config);
|
||||
return config;
|
||||
},
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
};
|
|
@ -19,10 +19,11 @@
|
|||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"cypress": "cypress run",
|
||||
"cypress:ci": "nyc instrument --compact=false cypress instrumented && cypress run --config-file cypress.config.ci.js",
|
||||
"cypress:open": "cypress open",
|
||||
"prettier:check": "prettier --check '**/*.{json,html,scss,ts,js}'",
|
||||
"prettier:fix": "prettier --write '**/*.{json,html,scss,ts,js}'",
|
||||
"coverage:ci": "nyc report --reporter=text-summary -t coverage --report-dir coverage/summary"
|
||||
"coverage:ci": "nyc report --reporter=text-summary"
|
||||
},
|
||||
"author": "Heimo Stranner",
|
||||
"license": "ISC"
|
||||
|
|
Loading…
Reference in a new issue