I have a requirejs + knockout application. When I try to setup cypress test framework I am getting some error. I tried to import the requirejs library in the spec file and a knockout viewModel file. But I am getting error when running the test cases
Uncaught ReferenceError: define is not defined
This error originated from your test code, not from Cypress.
This is what I tried. Anyone has inputs on this? Is there any plugins for cypress to work with requirejs application?
import '../../node_modules/requirejs/require';
import '../src/js/vm/mydemo';
describe('Demo Test', function() {
var vmTest = new MyDemo();
it('Does not do much!', function() {
expect(true).to.equal(true)
})
it('Visit home', function() {
cy.visit('http://localhost:8000/')
})
})
mydemo.js is a knockout viewModel file which uses requirejs define
mfunction
Aucun commentaire:
Enregistrer un commentaire