Skip to content

Commit

Permalink
Add failing bundle tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke committed Dec 7, 2019
1 parent c313335 commit 245b4ec
Show file tree
Hide file tree
Showing 8 changed files with 435 additions and 11 deletions.
26 changes: 19 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@ if (!process.env.TRAVIS){
process.env.CHROME_BIN = require('puppeteer').executablePath();
}

function getTestFiles(){
switch (process.env.BROWSER_BUNDLE_TEST){
case 'publishedDist': return ["packages/web3/dist/web3.min.js", "test/e2e.minified.js"]
case 'gitRepoDist': return ["dist/web3.min.js", "test/e2e.minified.js"]
default: return ["test/**/e2e*.js"]
}
}

// Only loads preprocessor for the logic unit tests
function getPreprocessors(){
if (!process.env.BROWSER_BUNDLE_TEST){
return { 'test/**/e2e*.js': [ 'browserify' ] }
}
}

module.exports = function (config) {
var configuration = {
frameworks: [
'mocha',
'browserify'
],
files: [
'test/**/e2e*.js'
],
preprocessors: {
'test/**/e2e*.js': [ 'browserify' ]
},
files: getTestFiles(),
preprocessors: getPreprocessors(),
failOnEmptyTestSuite: false,
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
Expand Down Expand Up @@ -52,4 +64,4 @@ module.exports = function (config) {
}

config.set(configuration);
};
};
Loading

0 comments on commit 245b4ec

Please sign in to comment.