mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-25 08:29:06 -06:00
* dependency: bump mime dep * changelog entry * yarn lock update * add pending to changelog * index on mime-dep-update:ccff6a976eadd pending to changelog * index on mime-dep-update:ccff6a976eadd pending to changelog * another removal of package * changelog update * index on mime-dep-update:ccff6a976eadd pending to changelog * whoops wrong issue * fix test that was just....wrong * Revert "fix test that was just....wrong" This reverts commit73ed5b0867. * nvm, application/javascript is obsolete * app/js to text/js updates * downgrade to mime 3.0.0 * back to application/javascript * index on mime-dep-update:23cbb7783bMerge branch 'mime-dep-update' of https://github.com/cypress-io/cypress into mime-dep-update * index on mime-dep-update:23cbb7783bMerge branch 'mime-dep-update' of https://github.com/cypress-io/cypress into mime-dep-update * index on mime-dep-update:23cbb7783bMerge branch 'mime-dep-update' of https://github.com/cypress-io/cypress into mime-dep-update --------- Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: AtofStryker <bglesias@gmail.com>
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
const express = require('express')
|
|
const Fixtures = require('../lib/fixtures')
|
|
const systemTests = require('../lib/system-tests').default
|
|
|
|
const e2ePath = Fixtures.projectPath('e2e')
|
|
|
|
let requestsForWebWorker = 0
|
|
let requestsForSharedWorker = 0
|
|
|
|
const onServer = function (app) {
|
|
app.use(express.static(e2ePath, {
|
|
// force caching to happen
|
|
maxAge: 3600000,
|
|
}))
|
|
|
|
app.get('/ww.js', (req, res) => {
|
|
requestsForWebWorker += 1
|
|
|
|
res.set('Content-Type', 'text/javascript')
|
|
res.set('Mime-Type', 'text/javascript')
|
|
|
|
return res.send('const x = 1')
|
|
})
|
|
|
|
app.get('/sw.js', (req, res) => {
|
|
requestsForSharedWorker += 1
|
|
|
|
res.set('Content-Type', 'text/javascript')
|
|
res.set('Mime-Type', 'text/javascript')
|
|
|
|
return res.send('const x = 1')
|
|
})
|
|
}
|
|
|
|
describe('e2e web worker', () => {
|
|
systemTests.setup({
|
|
servers: [{
|
|
https: true,
|
|
port: 1515,
|
|
onServer,
|
|
}],
|
|
})
|
|
|
|
systemTests.it('executes one spec with a web and shared worker', {
|
|
project: 'e2e',
|
|
spec: 'web_worker.cy.js',
|
|
onRun: async (exec, browser) => {
|
|
await exec()
|
|
expect(requestsForWebWorker).to.eq(2)
|
|
expect(requestsForSharedWorker).to.eq(2)
|
|
},
|
|
})
|
|
})
|