I started TDD development of my Meteor/Vue app using Cypress and documented how to get that running here: [Tutorial + Demo App] Testing Meteor Vue apps with Cypress
Now, I’m moving onto testing Mongo collections and am running into the following error
"Error: Webpack Compilation Error
./api/lists.js
Module not found: Error: Can't resolve 'meteor/mongo'"
This is the entirety of my list.js file:
import { Mongo } from "meteor/mongo";
export const Lists = new Mongo.Collection("lists");
I’ve tried “meteor npm install webpack-meteor-externals --save-dev” from: https://github.com/ardatan/meteor-webpack
and amended my “cypress/plugins/index.js” file (where webpack options can be put in without having to create a webpack.config.js file) with
const meteorExternals = require('webpack-meteor-externals');
//...
externals: [
meteorExternals()
]
//...
but then I get an error that Package in ““module.exports = Package[‘mongo’];”” cannot be found. I tried tracking down where Package was defined but no luck.
I’d appreciate any help in solving this problem.