quick-gpu-68223
09/15/2021, 1:25 PMimportant-river-75795
09/15/2021, 2:32 PMfancy-airplane-60156
09/16/2021, 10:31 AMimportant-river-75795
09/16/2021, 10:48 AMfancy-airplane-60156
09/16/2021, 10:49 AMfancy-airplane-60156
09/16/2021, 12:57 PMgray-kilobyte-89541
09/16/2021, 2:26 PMfancy-airplane-60156
09/17/2021, 1:37 AMjolly-helicopter-87687
09/21/2021, 1:18 PMTypeError: Failed to resolve module specifier "vue".
when running a basic test like cy.visit('/')
. Via cypress open
I'm assuming there's some devserver config I might be missing. So far I've only got this in the plugins index:
const path = require('path')
const { startDevServer } = require('@cypress/vite-dev-server')
module.exports = (on, config) => {
on('dev-server:start', (options) => {
return startDevServer({
options,
viteConfig: {
configFile: path.resolve(__dirname, '../../vite.config.js')
}
})
})
return config
}
Thoughts/pointers?bulky-sundown-74498
09/21/2021, 2:38 PMjs
const { startDevServer } = require('@cypress/vite-dev-server')
module.exports = (on, config) => {
on('dev-server:start', (options) => {
return startDevServer({
options
})
})
return config
}
jolly-helicopter-87687
09/21/2021, 3:56 PM/cypress/integrations/Basic.spec.js
js
describe('My First Test', () => {
it('Does not do much!', () => {
cy.visit('/')
expect(true).to.equal(true)
})
})
If you try to npx cypress open
now and run Basic.spec
you'll get a css loader error mentioning Webpack, oddly enough. So:
2. Commented out import '../../src/main.css'
from /cypress/support/index.js
which as I understand should only be needed for the components tests.
If you run Basic.spec
now you'll get the same error I'm having in my own app:
TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../".
bulky-sundown-74498
09/21/2021, 4:09 PMjolly-helicopter-87687
09/21/2021, 4:09 PMthankful-lunch-80439
09/21/2021, 11:21 PMcypress-real-events
instead of something like trigger
or invoke
. Though it seems that it's an acceptable solution that a lot of developers are using. Is there something I'm not trying?broad-river-71789
09/29/2021, 8:20 PMthankful-lunch-80439
09/29/2021, 8:41 PMbroad-river-71789
09/30/2021, 12:25 AMbroad-river-71789
09/30/2021, 12:26 AMthankful-lunch-80439
09/30/2021, 12:28 AMcy.intercept
then. Sounds like cy.intercept("POST", /api).as("createThing")
and cy.intercept("PATCH", /api/).as("editThing")
I don't know if this is a best practice, though may resolve the issue here @Userbroad-river-71789
09/30/2021, 12:29 AMthankful-lunch-80439
09/30/2021, 12:29 AMbroad-river-71789
09/30/2021, 12:42 AMthankful-lunch-80439
09/30/2021, 12:42 AMbroad-river-71789
09/30/2021, 12:43 AMthankful-lunch-80439
09/30/2021, 12:45 AMbroad-river-71789
09/30/2021, 12:49 AMimportant-river-75795
09/30/2021, 9:51 AMbroad-river-71789
09/30/2021, 1:45 PMbroad-river-71789
09/30/2021, 1:46 PMthankful-lunch-80439
10/02/2021, 5:53 AMjs
cy.wait("@rating", { timeout: 60000 }).then((xhr: any) => {
expect(xhr.statusCode).to.eq(200);
const quotestatus = xhr.response.body.isReferred;
cy.wrap(xhr.response.body.isReferred).as("quoteisrefBool");
});
a 60 second timeout is quite generous too 😅
Also, I could be wrong, though i think this may be clear for you too
js
cy.wait("@rating", { timeout: 60000 }).then({ response}) => {
expect(response.statusCode).to.eq(200);
cy.wrap(response.body.isReferred).as("quoteisrefBool");
});