This regular expression is used on next.config.js and is used to remove test attributes from the production build.
It filters any data attributes that starts with 'test', 'cy' or 'jest'.
Inputs: SPAN 1 SPAN 2 SPAN 3
Outputs: SPAN 1 SPAN 2 SPAN 3
Inputs: SPAN 1 SPAN 2 SPAN 3
Outputs: SPAN 1 SPAN 2 SPAN 3
Inputs: SPAN 1 SPAN 2 SPAN 3
Outputs: SPAN 1 SPAN 2 SPAN 3
module.exports = {
compiler: {
// The regexes defined here are processed in Rust so the syntax is different from
// JavaScript `RegExp`s. See https://docs.rs/regex.
reactRemoveProperties: { properties: ['^data-(test|cy|jest).*$'] },
},
}