fixed browser tests for async validation

master
Evgeny Poberezkin 2016-03-02 06:54:10 +00:00
parent 700cfb01a6
commit f4ca190010
5 changed files with 34 additions and 19 deletions

View File

@ -138,6 +138,10 @@ This bundle can be used with different module systems or creates global `Ajv` if
The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv).
Ajv is tested with these browsers:
[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin)
## Validation keywords

View File

@ -22,6 +22,11 @@ module.exports = function(config) {
browserName: 'chrome',
version: '27'
},
'SL_Chrome_37': {
base: 'SauceLabs',
browserName: 'chrome',
version: '37'
},
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome'
@ -45,11 +50,6 @@ module.exports = function(config) {
base: 'SauceLabs',
browserName: 'MicrosoftEdge'
},
'SL_FireFox_4': {
base: 'SauceLabs',
browserName: 'firefox',
version: '4'
},
'SL_FireFox_17': {
base: 'SauceLabs',
browserName: 'firefox',
@ -132,7 +132,7 @@ module.exports = function(config) {
testName: 'Ajv'
},
captureTimeout: 900000,
browserNoActivityTimeout: 500000,
browserNoActivityTimeout: 300000,
customLaunchers: customLaunchers,

View File

@ -22,7 +22,7 @@ var TRANSPILE = {
var MODES = [
{ async: 'co*' },
{ async: 'es7', transpile: 'nodent' },
{ async: 'es7', transpile: 'regenerator' }
{ async: 'co*', transpile: 'regenerator' }
];

View File

@ -1,6 +1,6 @@
{
"name": "ajv",
"version": "3.8.1",
"version": "3.8.2",
"description": "Another JSON Schema Validator",
"main": "lib/ajv.js",
"files": [

View File

@ -21,29 +21,40 @@ function getAjvInstances(opts) {
{ async: 'co*' },
{ async: 'es7' },
{ async: 'es7', transpile: 'nodent' },
{ async: '*', transpile: 'regenerator' },
{ async: 'co*', allErrors: true },
{ async: 'es7', allErrors: true },
{ async: 'es7', transpile: 'nodent', allErrors: true },
{ async: '*', transpile: 'regenerator', allErrors: true }
{ async: 'es7', transpile: 'nodent', allErrors: true }
];
var ua;
try { ua = window.navigator.userAgent.toLowerCase(); } catch(e) {}
// regenerator does not work in IE9
if (!/msie\s9/.test(ua)) {
options = options.concat([
{ async: '*', transpile: 'regenerator' },
{ async: '*', transpile: 'regenerator', allErrors: true }
]);
}
if (fullTest) {
options = options.concat([
{ async: '*' },
{ async: 'co*', transpile: 'regenerator' },
{ allErrors: true },
{ async: true, allErrors: true },
{ async: '*', allErrors: true },
{ async: 'co*', transpile: 'regenerator', allErrors: true }
{ async: '*', allErrors: true }
]);
var ua;
try { ua = window.navigator.userAgent.toLowerCase(); } catch(e) {}
if (!/msie\s9/.test(ua)) {
options = options.concat([
{ async: 'co*', transpile: 'regenerator' },
{ async: 'co*', transpile: 'regenerator', allErrors: true }
]);
}
// es7 functions transpiled with regenerator are excluded from test in Safari.
// They emit multiple 'uncaught exception' warnings in Safari anc cause remote tests to disconnect.
if (ua && (!/safari/.test(ua) || /chrome/.test(ua))) {
// es7 functions transpiled with regenerator are excluded from test in Safari/Firefox/Edge/IE9.
// They fail in IE9 and emit multiple 'uncaught exception' warnings in Safari/Firefox/Edge anc cause remote tests to disconnect.
if (ua && (!/safari/.test(ua) || /chrome|phantomjs/.test(ua)) && (!/firefox|edge|msie\s9/.test(ua))) {
options = options.concat([
{ transpile: 'regenerator' },
{ async: true, transpile: 'regenerator' },