3.0.25 • Published 3 years ago
@dnb-hugo/cypress-config v3.0.25
Usage
Add the configuration package to your setup:
npm install -D @dnb-hugo/cypress
Create tests/cypress/plugins.index.js
with the following content:
// noinspection JSUnresolvedVariable
module.exports = (on, config) =>
// eslint-disable-next-line global-require
require("@dnb-hugo/cypress-config")(config.configFile);
Then add in cypress.json
at least the following two lines:
{
"extends": "@dnb-hugo/cypress-config/base.json",
"pluginsFile": "tests/cypress/plugins/index.js"
}
This configuration setup uses the approach of Gleb Bahmutov's blog post.
Default settings of this configuration
- All cypress files reside within the
tests
directory (no need for additional directories in the root directory). - The base url is set to http://localhost:1313 - default for all Hugo dev server instances.
- IDEs like IntelliJ import the schema to offer typeahead code hints.
watchForFileChanges
is enabled.