@zeit/schemas
Advanced tools
Comparing version 1.6.2 to 1.6.3
const {EnvKeys, EnvObject} = require('./env'); | ||
const staticSchema = require('./config-static'); | ||
module.exports = { | ||
type: 'object', | ||
additionalProperties: false, | ||
dependencies: { | ||
slot: { | ||
type: 'object', | ||
required: ['features'], | ||
properties: { | ||
features: { | ||
type: 'object', | ||
required: ['cloud'], | ||
properties: { | ||
cloud: { | ||
'const': 'v2' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
properties: { | ||
@@ -107,4 +125,8 @@ 'name': { | ||
} | ||
}, | ||
'slot': { | ||
type: 'string', | ||
pattern: 'c.125-m512|staging-*' | ||
} | ||
} | ||
}; |
{ | ||
"name": "@zeit/schemas", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "All schemas used for validation that are shared between our projects", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -32,2 +32,39 @@ /* eslint camelcase: 0 */ | ||
exports.test_slot_key = () => { | ||
const isValid = ajv.validate(deploymentConfigSchema, { | ||
features: { | ||
cloud: 'v2' | ||
}, | ||
slot: 'c.125-m512' | ||
}); | ||
assert.equal(isValid, true); | ||
}; | ||
exports.test_staging_slot_key = () => { | ||
const isValid = ajv.validate(deploymentConfigSchema, { | ||
features: { | ||
cloud: 'v2' | ||
}, | ||
slot: 'staging-c.5-t1-w-m1024' | ||
}); | ||
assert.equal(isValid, true); | ||
}; | ||
exports.test_invalid_slot_key = () => { | ||
const isValid = ajv.validate(deploymentConfigSchema, { | ||
features: { | ||
cloud: 'v2' | ||
}, | ||
slot: 'invalid-key' | ||
}); | ||
assert.equal(isValid, false); | ||
}; | ||
exports.test_slot_key_without_cloud_v2 = () => { | ||
const isValid = ajv.validate(deploymentConfigSchema, { | ||
slot: 'c.125-m512' | ||
}); | ||
assert.equal(isValid, false); | ||
}; | ||
exports.test_invalid_features_object = () => { | ||
@@ -34,0 +71,0 @@ const isValid = ajv.validate(deploymentConfigSchema, { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70177
612
14