Skip to content

Commit

Permalink
fix(cypress): Make sure cypress can preprocess files corrently (this …
Browse files Browse the repository at this point in the history
…drops 78 dependencies)

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jul 23, 2023
1 parent 13b78b4 commit 3575675
Show file tree
Hide file tree
Showing 4 changed files with 2,470 additions and 5,725 deletions.
9 changes: 5 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import {
waitOnNextcloud,
} from './cypress/dockerNode'
import { defineConfig } from 'cypress'
import webpackPreprocessor from '@cypress/webpack-preprocessor'
import type { Configuration } from 'webpack'

import browserify from '@cypress/browserify-preprocessor'
import webpackConfig from './webpack.config.js'

export default defineConfig({
projectId: '37xpdh',
Expand Down Expand Up @@ -45,8 +47,7 @@ export default defineConfig({
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
async setupNodeEvents(on, config) {
// Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
on('file:preprocessor', browserify({ typescript: require.resolve('typescript') }))
on('file:preprocessor', webpackPreprocessor({ webpackOptions: webpackConfig as Configuration }))

// Disable spell checking to prevent rendering differences
on('before:browser:launch', (browser, launchOptions) => {
Expand Down Expand Up @@ -113,7 +114,7 @@ export default defineConfig({
},
])

const config = require('@nextcloud/webpack-vue-config')
const config = webpackConfig
config.module.rules.push({
test: /\.svg$/,
type: 'asset/source',
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import './commands'
import './commands.ts'
Loading

0 comments on commit 3575675

Please sign in to comment.