Skip to content

Commit

Permalink
Merge pull request #32 from sorry-cypress/feat/cypress-11
Browse files Browse the repository at this point in the history
Support Cypress 11
  • Loading branch information
agoldis authored Nov 11, 2022
2 parents 2d4bd92 + 613437e commit 1e8fc60
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.1.8-beta.0](https://github.com/sorry-cypress/cy2/compare/v3.1.7...v3.1.8-beta.0) (2022-11-11)


### Features

* monkey patch snapshot config ([d5a3fb9](https://github.com/sorry-cypress/cy2/commit/d5a3fb904dd95ea7f03e124cdbed713be0ac75b1))

## [3.1.7](https://github.com/sorry-cypress/cy2/compare/v3.1.6...v3.1.7) (2022-10-27)


Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cy2",
"version": "3.1.7",
"version": "3.1.8-beta.0",
"author": "Andrew Goldis",
"main": "./dist",
"typings": "./dist",
Expand Down Expand Up @@ -41,8 +41,10 @@
},
"keywords": [
"cypress",
"wrapper",
"sorry-cypress",
"cypress dashboard",
"cypress ci",
"cypress parallel",
"currents"
],
"devDependencies": {
Expand Down
15 changes: 15 additions & 0 deletions src/injected.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
const Mod = require('module');
const req = Mod.prototype.require;

// @ts-ignore
if (global.snapshotResult?.customRequire?.exports) {
// @ts-ignore
global.snapshotResult.customRequire.exports[
'./packages/server/config/app.json'
].exports = {
development: { api_url: 'http://localhost:1234/' },
test: { api_url: 'http://localhost:1234/' },
staging: { api_url: 'https://api-staging.cypress.io/' },
production: {
api_url: process.env.CYPRESS_API_URL || 'https://api.cypress.io',
},
};
}

Mod.prototype.require = function (...args) {
if (args[0] === 'konfig') {
return () => ({
Expand Down

0 comments on commit 1e8fc60

Please sign in to comment.