Hi all
I’ve just started testing with Cypress and I’m looking to modify the commands in Meteor. I’m on Meteor 2.1 and my project is having the following TypeError:
W20210305-15:08:53.485(0)? (STDERR) TypeError: Cannot read property 'add' of undefined
W20210305-15:08:53.485(0)? (STDERR) at module (cypress/support/commands.js:28:18)
W20210305-15:08:53.485(0)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)
W20210305-15:08:53.485(0)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)
W20210305-15:08:53.486(0)? (STDERR) at require (packages/modules-runtime.js:258:21)
W20210305-15:08:53.486(0)? (STDERR) at tailwind.config.js:1:1
W20210305-15:08:53.486(0)? (STDERR) at /home/chris/Work/gc.meteor.com/.meteor/local/build/programs/server/boot.js:401:38
W20210305-15:08:53.486(0)? (STDERR) at Array.forEach (<anonymous>)
W20210305-15:08:53.486(0)? (STDERR) at /home/chris/Work/gc.meteor.com/.meteor/local/build/programs/server/boot.js:226:21
W20210305-15:08:53.486(0)? (STDERR) at /home/chris/Work/gc.meteor.com/.meteor/local/build/programs/server/boot.js:464:7
W20210305-15:08:53.486(0)? (STDERR) at Function.run (/home/chris/Work/gc.meteor.com/.meteor/local/build/programs/server/profile.js:280:14)
W20210305-15:08:53.486(0)? (STDERR) at /home/chris/Work/gc.meteor.com/.meteor/local/build/programs/server/boot.js:463:13
My Commands file:
import Cypress from 'cypress'
Cypress.Commands.add('resetDb', () => {
const mongoport = 3001
cy.exec(`mongorestore --host localhost:${mongoport} --drop --gzip --archive=./tests/testFixtures.agz`)
})
I’ve tried Importing and Requiring Cypress in various ways and I can’t figure out what’s causing it.
Any thoughts or suggestions would be much appreciated!