Skip to content

Commit

Permalink
Merge pull request #921 from help-me-mom/issues/stackblitz
Browse files Browse the repository at this point in the history
feat(stackblitz.com): running examples correctly
  • Loading branch information
satanTime authored Nov 19, 2023
2 parents 5e478dc + 4331ec9 commit 7763b38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .stackblitzrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"installDependencies": true,
"startCommand": "npm start",
"env": {
"SB": "true"
}
}
17 changes: 9 additions & 8 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// https://karma-runner.github.io/1.0/config/configuration-file.html

const isCSB = !!process.env.CSB;
const isLocal = !isCSB;
const withCoverage = !isCSB && !!process.env.WITH_COVERAGE;
const isSB = !!process.env.SB;
const isLocal = !isCSB && !isSB;
const withCoverage = isLocal && !!process.env.WITH_COVERAGE;

if (isLocal) {
process.env.CHROME_BIN = require('puppeteer').executablePath();
Expand Down Expand Up @@ -42,14 +43,14 @@ module.exports = function (config) {
outputFile: 'specs-junit.xml',
useBrowserName: false,
},
reporters: withCoverage ? ['junit'] : isCSB ? ['kjhtml'] : ['dots', 'kjhtml'],
hostname: isCSB ? 'random-4200.csb.app' : 'localhost',
listenAddress: isCSB ? '0.0.0.0' : 'localhost',
port: isCSB ? 4200 : 9876,
reporters: withCoverage ? ['junit'] : isCSB || isSB ? ['kjhtml'] : ['dots', 'kjhtml'],
hostname: isCSB ? 'random-4200.csb.app' : isSB ? 'random.github.stackblitz.io' : 'localhost',
listenAddress: isCSB || isSB ? '0.0.0.0' : 'localhost',
port: isCSB ? 4200 : isSB ? 80 : 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: isCSB,
browsers: isCSB ? [] : ['ChromeCi'],
autoWatch: isCSB || isSB,
browsers: isCSB || isSB ? [] : ['ChromeCi'],
singleRun: isLocal,
});
};

0 comments on commit 7763b38

Please sign in to comment.