test-fast npm script

master
Evgeny Poberezkin 2015-10-19 22:51:05 +01:00
parent 39b2bf5c54
commit 3a38a935c5
2 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@
"scripts": {
"jshint": "jshint lib/**/*.js --exclude lib/dotjs/**/*",
"test-spec": "mocha spec/*.spec.js -R spec",
"test-fast": "AJV_FAST_TEST=true npm run test-spec",
"test-cov": "istanbul cover -x '**/spec/**' node_modules/mocha/bin/_mocha -- spec/*.spec.js -R spec",
"bundle": "browserify -r ./lib/ajv.js:ajv -o ajv.bundle.js",
"build": "node scripts/compile-dots.js",

View File

@ -3,10 +3,11 @@
var jsonSchemaTest = require('json-schema-test')
, getAjvInstances = require('./ajv_instances');
var isBrowser = typeof window == 'object';
var Ajv = require(isBrowser ? 'ajv' : '../lib/ajv');
var Ajv = require(typeof window == 'object' ? 'ajv' : '../lib/ajv');
var instances = getAjvInstances({
var fullTest = isBrowser || !process.env.AJV_FAST_TEST;
var instances = getAjvInstances(fullTest ? {
beautify: true,
allErrors: true,
verbose: true,
@ -14,7 +15,7 @@ var instances = getAjvInstances({
inlineRefs: false,
jsonPointers: true,
i18n: true
});
} : { allErrors: true });
var remoteRefs = {
// for JSON-Schema-Test-Suite