Hey all, trying to run some tests and mock out cer...
# help
t
Hey all, trying to run some tests and mock out cerbos calls in cypress (typescript) but am now getting this error? anyone know of a quick fix for this
Copy code
Error: Webpack Compilation Error
./node_modules/@cerbos/http/lib/index.js 177:56
Module parse failed: Unexpected token (177:56)
Seemed to be due to the preprocessor in cypress, had to change the preprocessor to vite in cypress.config.ts
Copy code
export default defineConfig({
  e2e: {
    setupNodeEvents(on) {
      on('file:preprocessor', vitePreprocessor())
    },...})
a
Glad it’s sorted. Good to know cypress needs modification for Vite. What’s your use case for Cerbos?
t
Managing visibility of components on the front end based around roles at the moment, also a blocking access to some apis on the back end. In the end for front end testing,i've gotten completely away from stubbing and am just intercepting the cerbos api calls