mirror of
https://github.com/twitter/twemoji.git
synced 2024-06-15 03:35:16 +00:00
hopefully fixed travis
This commit is contained in:
parent
064f051c95
commit
c11b7629fc
@ -1,34 +0,0 @@
|
|||||||
console.log('Loading: test.html');
|
|
||||||
var page = require('webpage').create();
|
|
||||||
var url = '2/test/index.html';
|
|
||||||
page.open(url, function (status) {
|
|
||||||
if (status === 'success') {
|
|
||||||
var results = page.evaluate(function() {
|
|
||||||
// remove the first node with the total from the following counts
|
|
||||||
var passed = Math.max(0, document.querySelectorAll('.pass').length - 1);
|
|
||||||
return {
|
|
||||||
// retrieve the total executed tests number
|
|
||||||
total: ''.concat(
|
|
||||||
passed,
|
|
||||||
' blocks (',
|
|
||||||
document.querySelector('#wru strong').textContent.replace(/\D/g, ''),
|
|
||||||
' single tests)'
|
|
||||||
),
|
|
||||||
passed: passed,
|
|
||||||
failed: Math.max(0, document.querySelectorAll('.fail').length - 1),
|
|
||||||
errored: Math.max(0, document.querySelectorAll('.error').length - 1)
|
|
||||||
};
|
|
||||||
});
|
|
||||||
console.log('- - - - - - - - - -');
|
|
||||||
console.log('total: ' + results.total);
|
|
||||||
console.log('- - - - - - - - - -');
|
|
||||||
console.log('passed: ' + results.passed);
|
|
||||||
console.log('failed: ' + results.failed);
|
|
||||||
console.log('errored: ' + results.errored);
|
|
||||||
console.log('- - - - - - - - - -');
|
|
||||||
if (0 < results.failed + results.errored) {
|
|
||||||
status = 'failed';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
phantom.exit(status === 'success' ? 0 : 1);
|
|
||||||
});
|
|
@ -27,6 +27,6 @@
|
|||||||
},
|
},
|
||||||
"main": "./twemoji.npm.js",
|
"main": "./twemoji.npm.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "phantomjs testrunner.js && phantomjs 2/test/testrunner.js"
|
"test": "phantomjs testrunner.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,48 @@
|
|||||||
console.log('Loading: test.html');
|
var
|
||||||
var page = require('webpage').create();
|
webpage = require('webpage'),
|
||||||
var url = 'test.html';
|
urls = [
|
||||||
page.open(url, function (status) {
|
'2/test/index.html',
|
||||||
if (status === 'success') {
|
'test.html'
|
||||||
var results = page.evaluate(function() {
|
]
|
||||||
// remove the first node with the total from the following counts
|
;
|
||||||
var passed = Math.max(0, document.querySelectorAll('.pass').length - 1);
|
|
||||||
return {
|
(function test() {'use strict';
|
||||||
// retrieve the total executed tests number
|
var page, url = urls.shift();
|
||||||
total: ''.concat(
|
if (!url) return phantom.exit(0);
|
||||||
passed,
|
console.log('Loading: ' + url);
|
||||||
' blocks (',
|
page = webpage.create();
|
||||||
document.querySelector('#wru strong').textContent.replace(/\D/g, ''),
|
page.open(url, function (status) {
|
||||||
' single tests)'
|
if (status === 'success') {
|
||||||
),
|
setTimeout(function () {
|
||||||
passed: passed,
|
var results = page.evaluate(function() {
|
||||||
failed: Math.max(0, document.querySelectorAll('.fail').length - 1),
|
// remove the first node with the total from the following counts
|
||||||
errored: Math.max(0, document.querySelectorAll('.error').length - 1)
|
var passed = Math.max(0, document.querySelectorAll('.pass').length - 1);
|
||||||
};
|
return {
|
||||||
});
|
// retrieve the total executed tests number
|
||||||
console.log('- - - - - - - - - -');
|
total: ''.concat(
|
||||||
console.log('total: ' + results.total);
|
passed,
|
||||||
console.log('- - - - - - - - - -');
|
' blocks (',
|
||||||
console.log('passed: ' + results.passed);
|
document.querySelector('#wru strong').textContent.replace(/\D/g, ''),
|
||||||
console.log('failed: ' + results.failed);
|
' single tests)'
|
||||||
console.log('errored: ' + results.errored);
|
),
|
||||||
console.log('- - - - - - - - - -');
|
passed: passed,
|
||||||
if (0 < results.failed + results.errored) {
|
failed: Math.max(0, document.querySelectorAll('.fail').length - 1),
|
||||||
status = 'failed';
|
errored: Math.max(0, document.querySelectorAll('.error').length - 1)
|
||||||
}
|
};
|
||||||
}
|
});
|
||||||
phantom.exit(status === 'success' ? 0 : 1);
|
page.stop();
|
||||||
});
|
page.close();
|
||||||
|
console.log('- - - - - - - - - -');
|
||||||
|
console.log('total: ' + results.total);
|
||||||
|
console.log('- - - - - - - - - -');
|
||||||
|
console.log('passed: ' + results.passed);
|
||||||
|
console.log('failed: ' + results.failed);
|
||||||
|
console.log('errored: ' + results.errored);
|
||||||
|
console.log('- - - - - - - - - -');
|
||||||
|
if (0 < results.failed + results.errored) {
|
||||||
|
phantom.exit(1);
|
||||||
|
} else test();
|
||||||
|
}, 1000);
|
||||||
|
} else phantom.exit(1);
|
||||||
|
});
|
||||||
|
}());
|
Loading…
Reference in New Issue
Block a user