summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidstutz <davidstutz@web.de>2016-08-21 18:39:33 +0200
committerdavidstutz <davidstutz@web.de>2016-08-21 18:39:33 +0200
commit91a0f2f57c08aeb5395ba0095434ad615cbee8eb (patch)
tree95c539fb32857903f14aaab426fa8b70815df8bf
parentbd31fb99aa93feef4858331c046d9d4337ff947e (diff)
downloadpassword-score-91a0f2f57c08aeb5395ba0095434ad615cbee8eb.zip
password-score-91a0f2f57c08aeb5395ba0095434ad615cbee8eb.tar.gz
password-score-91a0f2f57c08aeb5395ba0095434ad615cbee8eb.tar.bz2
Travis continuous integration ...
-rw-r--r--.travis.yml10
-rw-r--r--package.json35
-rw-r--r--tests/karma.conf.js77
3 files changed, 122 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..084b9cd
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,10 @@
+language: node_js
+node_js:
+ - "0.10"
+
+script: karma start tests/karma.conf.js --single-run
+
+before_install:
+ - export CHROME_BIN=chromium-browser
+ - export DISPLAY=:99.0
+ - sh -e /etc/init.d/xvfb start
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..a3bfd53
--- /dev/null
+++ b/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "password-score",
+ "version": "1.0.0",
+ "description": "JavaScript library used to give realistic estimates of the strength of a password.",
+ "main": "dist/js/password-score.js",
+ "directories": {
+ "doc": "docs",
+ "test": "tests"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/davidstutz/password-score"
+ },
+ "keywords": [
+ "js",
+ "password"
+ ],
+ "author": "David Stutz",
+ "license": "BSD 3-Clause",
+ "bugs": {
+ "url": "https://github.com/davidstutz/password-score/issues"
+ },
+ "homepage": "https://github.com/davidstutz/password-score",
+ "scripts": {
+ "test": "karma start tests/karma.conf.js --single-run"
+ },
+ "devDependencies": {
+ "jasmine-core": "*",
+ "karma": "*",
+ "karma-cli": "*",
+ "karma-jasmine": "*",
+ "karma-phantomjs-launcher": "*",
+ "karma-chrome-launcher": "*"
+ }
+}
diff --git a/tests/karma.conf.js b/tests/karma.conf.js
new file mode 100644
index 0000000..c843ed2
--- /dev/null
+++ b/tests/karma.conf.js
@@ -0,0 +1,77 @@
+// Karma configuration
+// Generated on Wed Aug 17 2016 00:01:09 GMT+0200 (Mitteleuropäische Sommerzeit)
+
+module.exports = function(config) {
+ var configuration = {
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '',
+
+ // plugins starting with karma- are autoloaded
+ plugins: ['karma-chrome-launcher', 'karma-jasmine'],
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ['jasmine'],
+
+ // list of files / patterns to load in the browser
+ files: [
+ 'lib/xdate.js',
+ '../dist/js/password-score.js',
+ 'spec/*.js'
+ ],
+
+ // list of files to exclude
+ exclude: [
+ ],
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ },
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['progress'],
+
+ // web server port
+ port: 9876,
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['Chrome'],
+
+ // e.g see https://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
+ customLaunchers: {
+ Chrome_travis_ci: {
+ base: 'Chrome',
+ flags: ['--no-sandbox']
+ }
+ },
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false,
+
+ // Concurrency level
+ // how many browser should be started simultaneous
+ concurrency: Infinity
+ };
+
+ if (process.env.TRAVIS) {
+ configuration.browsers = ['Chrome_travis_ci'];
+ }
+
+ config.set(configuration);
+}