cypress: install package "@cypress/webpack-preprocessor"
"https://github.com/cypress-io/cypress-webpack-preprocessor" Change-Id: Id261c7d1675c6f6c30d5f1661b4988511528b0d7 Signed-off-by: Henry Castro <hcastro@collabora.com>pull/6868/head
parent
1ac16a13f1
commit
e69969a07b
|
@ -4,6 +4,7 @@
|
|||
"description": "Cypress integration test suit",
|
||||
"license": "MPL-2.0",
|
||||
"devDependencies": {
|
||||
"@cypress/webpack-preprocessor": "^5.17.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.21.0",
|
||||
"@typescript-eslint/parser": "^4.21.0",
|
||||
"cypress": "12.11.0",
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* global require */
|
||||
|
||||
/* global require __dirname */
|
||||
var process = require('process');
|
||||
var tasks = require('./tasks');
|
||||
var tagify = require('cypress-tags');
|
||||
var path = require('path');
|
||||
var webpackPreprocessor = require('@cypress/webpack-preprocessor');
|
||||
|
||||
function plugin(on, config) {
|
||||
if (config.env.COVERAGE_RUN)
|
||||
|
@ -43,7 +44,21 @@ function plugin(on, config) {
|
|||
config.defaultCommandTimeout = 10000;
|
||||
}
|
||||
|
||||
on('file:preprocessor', tagify.tagify(config));
|
||||
var tagsFunc = tagify.tagify(config);
|
||||
var webpackFunc = webpackPreprocessor({
|
||||
webpackOptions: {
|
||||
resolve: {
|
||||
modules:[ path.resolve(__dirname, process.env.NODE_PATH)]
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
on('file:preprocessor', function(file) {
|
||||
if (file.filePath.includes('integration')) {
|
||||
return tagsFunc(file);
|
||||
}
|
||||
return webpackFunc(file);
|
||||
});
|
||||
|
||||
return config;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue