-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from Autre31415/karmaTesting
Automate client tests with karma
- Loading branch information
Showing
12 changed files
with
217 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
reporting: | ||
dir: ./coverage/server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
before_install: | ||
- export CHROME_BIN=chromium-browser | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
after_success: | ||
- istanbul cover ./node_modules/mocha/bin/_mocha | ||
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls | ||
- karma start | ||
- lcov-result-merger 'coverage/**/lcov.info' 'coverage/fullCoverage.info' | ||
- cat ./coverage/fullCoverage.info | ./node_modules/.bin/coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Karma configuration | ||
|
||
module.exports = function(config) { | ||
var configuration = { | ||
basePath: '', | ||
frameworks: ['mocha'], | ||
files: [ | ||
'teddy.js', | ||
'test/models/*.js', | ||
'node_modules/chai/chai.js', | ||
'node_modules/chai-string/chai-string.js', | ||
'test/templates/**/*', | ||
'test/*.js', | ||
'test/client.html' | ||
], | ||
reporters: ['spec', 'coverage'], | ||
port: 8000, | ||
proxies: { | ||
'/templates/': '/base/test/templates/', | ||
}, | ||
preprocessors: { | ||
'teddy.js': ['coverage'], | ||
'test/templates/**/*': ['html2js'] | ||
}, | ||
html2JsPreprocessor: { | ||
stripPrefix: 'test/templates/' | ||
}, | ||
specReporter: { | ||
maxLogLines: 5, | ||
suppressErrorSummary: false, | ||
suppressFailed: false, | ||
suppressPassed: false, | ||
suppressSkipped: false, | ||
showSpecTiming: true | ||
}, | ||
coverageReporter: { | ||
type: 'lcov', | ||
dir: 'coverage/', | ||
subdir: function(browser) { | ||
return browser.toLowerCase().split(/[ /-]/)[0]; | ||
} | ||
}, | ||
client: { | ||
mocha: { | ||
reporter: 'html' | ||
} | ||
}, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: false, | ||
singleRun: true, | ||
browsers: ['Chrome'], | ||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
concurrency: 1 | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
configuration.browsers = ['Chrome_travis_ci']; | ||
} | ||
|
||
config.set(configuration); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.