Skip to content

Commit

Permalink
Add karma proxy middleware only on integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-lee committed Apr 7, 2023
1 parent a863d5f commit b53025c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion karma.conf.js
Expand Up @@ -119,7 +119,9 @@ module.exports = function karma(config) {
dir: 'coverage/',
},

middleware: ['proxy'],
middleware: process.env.npm_lifecycle_event === 'test-browser-integration'
? ['proxy']
: [],

plugins: [
'karma-*',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -36,10 +36,10 @@
"test": "npm run test-node && npm run test-browser",
"test-specs": "npm run test-node-specs && npm run test-browser-specs",
"test-integration": "npm run test-node-integration && npm run test-browser-integration",
"test-browser": "cross-env NODE_ENV=test karma start --singleRun=true",
"test-browser": "npm run test-browser-specs && npm run test-browser-integration",
"test-browser-specs": "cross-env NODE_ENV=test karma start --singleRun=true --dir=test/specs",
"test-browser-integration": "cross-env NODE_ENV=test karma start --singleRun=true --dir=test/integration",
"test-node": "cross-env NODE_ENV=test nyc mocha --require @babel/register --file test/helpers/nodeTestSetup.js --recursive test",
"test-node": "npm run test-node-specs && npm run test-node-integration",
"test-node-specs": "cross-env NODE_ENV=test nyc mocha --require @babel/register --recursive test/specs",
"test-node-integration": "cross-env NODE_ENV=test nyc mocha --require @babel/register --file test/helpers/nodeTestSetup.js --recursive test/integration"
},
Expand Down

0 comments on commit b53025c

Please sign in to comment.