Skip to content

Commit

Permalink
Merge e016607 into 77d510b
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed May 6, 2015
2 parents 77d510b + e016607 commit d4eac81
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 19 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: node_js
node_js:
- "0.10"
- "0.12.2"
- iojs
- "stable"
before_script:
- npm install -g grunt-cli
script:
- grunt test
- grunt coveralls
- grunt build
- grunt test_and_coveralls
- grunt saucelabs || true
44 changes: 33 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ module.exports = function(grunt) {
}
}
},
connect: {
server: {
options: {
port: 3000,
base: './test'
}
}
},
copy: {
test: {
expand: true,
Expand All @@ -19,26 +27,39 @@ module.exports = function(grunt) {
},
mocha_istanbul: {
coverage: {
src: 'test'
src: 'test',
options: {
timeout: 6000,
}
},
coveralls: {
src: ['test'],
options: {
coverage:true,
timeout: 6000,
reportFormats: ['cobertura','lcovonly']
}
}
},
mocha_phantomjs: {
all: ['test/**/*.html']
},
mochaTest: {
unittests: {
'saucelabs-mocha': {
all: {
options: {
reporter: 'spec'
},
src: [ 'test/unittests.js' ]
}
username: 'evilaliv3',
key: '226224a2-430f-4633-830b-d33640621fee',
urls: ['http://127.0.0.1:3000/unittests.html'],
build: process.env.TRAVIS_JOB_ID,
testname: 'Sauce Unit Test for scrypt-async-js',
browsers: grunt.file.readYAML('grunt/sauce_browsers.yml'),
public: "public",
maxRetries: 3,
throttled: 2,
pollInterval: 4000,
statusCheckAttempts: 200
}
},
},
uglify: {
scrypt: {
Expand All @@ -53,11 +74,12 @@ module.exports = function(grunt) {
});

grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-mocha-istanbul')
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-saucelabs');

grunt.event.on('coverage', function(lcov, done){
require('coveralls').handleInput(lcov, function(err){
Expand All @@ -69,7 +91,7 @@ module.exports = function(grunt) {
});

grunt.registerTask('build', ['uglify']);
grunt.registerTask('coverage', ['mocha_istanbul:coverage']);
grunt.registerTask('coveralls', ['mocha_istanbul:coveralls']);
grunt.registerTask('test', ['browserify', 'copy:test', 'mochaTest', 'mocha_phantomjs']);
grunt.registerTask('test', ['browserify', 'copy:test', 'mocha_istanbul', 'mocha_phantomjs']);
grunt.registerTask('test_and_coveralls', ['browserify', 'copy:test', 'mocha_istanbul:coveralls', 'mocha_phantomjs']);
grunt.registerTask('saucelabs', ['connect', 'saucelabs-mocha']);
};
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ scrypt-async
[![Build Status](https://travis-ci.org/dchest/scrypt-async-js.svg?branch=master)](https://travis-ci.org/dchest/scrypt-async-js)
[![Coverage Status](https://coveralls.io/repos/dchest/scrypt-async-js/badge.svg)](https://coveralls.io/r/dchest/scrypt-async-js)

[![Saucelabs Test Status](https://saucelabs.com/browser-matrix/evilaliv3.svg)](https://saucelabs.com/u/evilaliv3)

Fast "async" scrypt implementation in JavaScript.

Works in browsers without throwing out "kill slow script" warnings due to
Expand Down
75 changes: 75 additions & 0 deletions grunt/sauce_browsers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[
# Docs: https://saucelabs.com/docs/platforms/webdriver

{
browserName: "safari",
platform: "OS X 10.10"
},
{
browserName: "chrome",
platform: "OS X 10.10"
},
{
browserName: "firefox",
platform: "OS X 10.10"
},

# Mac Opera not currently supported by Sauce Labs

{
browserName: "internet explorer",
version: "11",
platform: "Windows 8.1"
},
{
browserName: "internet explorer",
version: "10",
platform: "Windows 8"
},
{
browserName: "internet explorer",
version: "9",
platform: "Windows 7"
},
{
browserName: "internet explorer",
version: "8",
platform: "Windows 7"
},

# { # Unofficial
# browserName: "internet explorer",
# version: "7",
# platform: "Windows XP"
# },

{
browserName: "chrome",
platform: "Windows 8.1"
},
{
browserName: "firefox",
platform: "Windows 8.1"
},

# Win Opera 15+ not currently supported by Sauce Labs

{
browserName: "iphone",
platform: "OS X 10.10",
version: "8.2"
},

# iOS Chrome not currently supported by Sauce Labs

# Linux (unofficial)
{
browserName: "chrome",
platform: "Linux"
},
{
browserName: "firefox",
platform: "Linux"
}

]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"coveralls": "^2.11.2",
"grunt": "0.4.5",
"grunt-browserify": "~3.8.0",
"grunt-contrib-connect": "0.10.1",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-uglify": "0.9.1",
"grunt-mocha-istanbul": "^2.4.0",
"grunt-mocha-phantomjs": "0.6.1",
"grunt-mocha-test": "~0.12.7",
"grunt-text-replace": "~0.4.0",
"grunt-saucelabs": "8.6.1",
"istanbul": "^0.3.13",
"mocha": "~2.2.4",
"mocha-phantomjs": "~3.5.3",
Expand Down
24 changes: 23 additions & 1 deletion test/unittests.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,29 @@
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
} else {
mocha.run();
var runner = mocha.run();

var failedTests = [];

runner.on('end', function(){
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
});

runner.on('fail', logFailure);

function logFailure(test, err) {
var flattenTitles = function(test) {
var titles = [];
while (test.parent.title) {
titles.push(test.parent.title);
test = test.parent;
}
return titles.reverse();
};

failedTests.push({name: test.title, result: false, message: err.message, stack: err.stack, titles: flattenTitles(test)});
};
}
</script>
</body>
Expand Down

0 comments on commit d4eac81

Please sign in to comment.