@asyncapi/converter
Advanced tools
Comparing version 0.6.2 to 0.7.0
@@ -35,3 +35,3 @@ #!/usr/bin/env node | ||
if (!version) { | ||
version = '2.2.0'; | ||
version = '2.3.0'; | ||
} | ||
@@ -38,0 +38,0 @@ |
@@ -25,2 +25,3 @@ const yaml = require('js-yaml'); | ||
'2.2.0': from__2_1_0__to__2_2_0, | ||
'2.3.0': from__2_2_0__to__2_3_0, | ||
} | ||
@@ -196,12 +197,15 @@ const conversionVersions = Object.keys(conversions); | ||
function from__2_0_0__to__2_1_0(asyncapi2) { | ||
const result = asyncapi2; | ||
result.asyncapi = '2.1.0'; | ||
return result; | ||
function from__2_0_0__to__2_1_0(asyncapi) { | ||
asyncapi.asyncapi = '2.1.0'; | ||
return asyncapi; | ||
} | ||
function from__2_1_0__to__2_2_0(asyncapi2) { | ||
const result = asyncapi2; | ||
result.asyncapi = '2.2.0'; | ||
return result; | ||
function from__2_1_0__to__2_2_0(asyncapi) { | ||
asyncapi.asyncapi = '2.2.0'; | ||
return asyncapi; | ||
} | ||
function from__2_2_0__to__2_3_0(asyncapi) { | ||
asyncapi.asyncapi = '2.3.0'; | ||
return asyncapi; | ||
} |
{ | ||
"name": "@asyncapi/converter", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"description": "Convert AsyncAPI documents from older to newer versions.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -182,2 +182,16 @@ const assert = require('assert'); | ||
}); | ||
it('should convert from 2.1.0 to 2.3.0', () => { | ||
const input = fs.readFileSync(path.resolve(__dirname, 'input', '2.1.0', 'streetlights.yml'), 'utf8'); | ||
const output = fs.readFileSync(path.resolve(__dirname, 'output', '2.3.0', 'streetlights.yml'), 'utf8'); | ||
const result = convert(input, '2.3.0'); | ||
assertResults(output, result); | ||
}); | ||
it('should convert from 2.2.0 to 2.3.0', () => { | ||
const input = fs.readFileSync(path.resolve(__dirname, 'input', '2.2.0', 'streetlights.yml'), 'utf8'); | ||
const output = fs.readFileSync(path.resolve(__dirname, 'output', '2.3.0', 'streetlights.yml'), 'utf8'); | ||
const result = convert(input, '2.3.0'); | ||
assertResults(output, result); | ||
}); | ||
}); | ||
@@ -184,0 +198,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
216251
48
472