e2e and unt test runners working

This commit is contained in:
Carlos Jimenez Ruiz 2022-03-11 17:28:30 +01:00
parent 7f576d3af4
commit 52d4dba950
4 changed files with 9 additions and 12 deletions

View File

@ -9,15 +9,12 @@
"lint": "eslint --ext .js,.ts,.vue ./",
"format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:unit": "cypress open-ct",
"test:unit:ci": "cypress run-ct",
"test:unit:coverage": "jest --coverage",
"test:unit:watch": "jest --watch",
"test:unit:watchAll": "jest --watchAll",
"test:unit": "jest --watchAll",
"test:e2e": "cross-env E2E_TEST=true start-test \"quasar dev\" http-get://localhost:8080 \"cypress open --config-file cypress.json\"",
"test:e2e:ci": "cross-env E2E_TEST=true start-test \"quasar dev\" http-get://localhost:8080 \"cypress run\"",
"serve:test:coverage": "quasar serve test/jest/coverage/lcov-report/ --port 8788",
"concurrently:dev:jest": "concurrently \"quasar dev\" \"jest --watch\"",
"test:e2e": "cross-env E2E_TEST=true start-test \"quasar dev\" http-get://localhost:8080 \"cypress open\"",
"test:e2e:ci": "cross-env E2E_TEST=true start-test \"quasar dev\" http-get://localhost:8080 \"cypress run\""
"concurrently:dev:jest": "concurrently \"quasar dev\" \"jest --watch\""
},
"dependencies": {
"@quasar/extras": "^1.0.0",

View File

@ -10,7 +10,7 @@ describe('Landing', () => {
cy.visit('/');
});
it('.should() - assert that <title> is correct', () => {
cy.title().should('include', 'Quasar');
cy.title().should('include', 'Salix');
});
});

View File

@ -25,9 +25,9 @@ const {
module.exports = async (on, config) => {
// Enable component testing, you can safely remove this
// if you don't plan to use Cypress for unit tests
if (config.testingType === 'component') {
await injectDevServer(on, config);
}
// if (config.testingType === 'component') {
// await injectDevServer(on, config);
// }
return config;
};

View File

@ -19,7 +19,7 @@ describe('MyButton', () => {
const wrapper = mount(MyButton);
const { vm } = wrapper;
expect((vm.$el as HTMLElement).textContent).toContain('rocket muffin');
expect((vm.$el).textContent).toContain('rocket muffin');
expect(wrapper.find('.content').text()).toContain('rocket muffin');
});