From 2b01ecca0507e0f5d01c80dbeba0109e3b2d4b59 Mon Sep 17 00:00:00 2001 From: Dhwaneet Bhatt Date: Wed, 29 Mar 2023 15:02:52 +0530 Subject: [PATCH 1/3] Add language label for kotlin and rust --- lib/assets/languageLabels.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/assets/languageLabels.json b/lib/assets/languageLabels.json index 01a44ec54..8078f4d65 100644 --- a/lib/assets/languageLabels.json +++ b/lib/assets/languageLabels.json @@ -6,6 +6,7 @@ "python": "Python", "ruby": "Ruby", "java": "Java", + "kotlin": "Kotlin", "c": "C", "php": "PHP", "objective-c": "Objective-C", @@ -19,5 +20,6 @@ "ocaml": "OCaml", "shell": "Shell", "dart": "Dart", - "r": "R" + "r": "R", + "rust": "Rust" } From 373b51163b2a83c456379873667e3dfff068cad1 Mon Sep 17 00:00:00 2001 From: Dhwaneet Bhatt Date: Wed, 29 Mar 2023 15:09:00 +0530 Subject: [PATCH 2/3] Releasing v1.7.1 --- CHANGELOG.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19545a7b1..5bc029b3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v1.7.1 (March 29, 2023) +* Minor fix - Add language labels for Rust and Kotlin + v1.7.0 (March 28, 2023) * Fix for - [#192](https://github.com/postmanlabs/postman-code-generators/issues/192) Added support for Rust reqwest code snippets. diff --git a/package-lock.json b/package-lock.json index 11a96ad2a..39d8ad364 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "postman-code-generators", - "version": "1.7.0", + "version": "1.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 17e48de51..750ff1db6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postman-code-generators", - "version": "1.7.0", + "version": "1.7.1", "description": "Generates code snippets for a postman collection", "main": "index.js", "directories": { From d11cbcf034faa1ca746bc4939beab1df9afc6408 Mon Sep 17 00:00:00 2001 From: Dhwaneet Bhatt Date: Wed, 29 Mar 2023 15:23:56 +0530 Subject: [PATCH 3/3] Add a test to assert that each language has a valid label --- npm/test.sh | 3 +++ test/unit/lib.test.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/unit/lib.test.js diff --git a/npm/test.sh b/npm/test.sh index a2757b4a0..6b340c5d0 100755 --- a/npm/test.sh +++ b/npm/test.sh @@ -59,6 +59,9 @@ else # check for .gitignore, license.md, readme.md, .eslintrc and package.json mocha ./test/system/repository.test.js; + # runs test to see if the codegen interface is implemented correctly + mocha ./test/unit/lib.test.js; + # Common structure and npm test for each codegen. echo -e "Running codegen-structure tests on all the codegens"; for directory in codegens/*; do diff --git a/test/unit/lib.test.js b/test/unit/lib.test.js new file mode 100644 index 000000000..77ad8c314 --- /dev/null +++ b/test/unit/lib.test.js @@ -0,0 +1,19 @@ +const expect = require('chai').expect, + lib = require('../../lib'), + labels = require('../../lib/assets/languageLabels.json'); + +describe('lib', function () { + describe('getLanguageList', function () { + it('should test that each language has a valid label', function () { + const list = lib.getLanguageList(); + + expect(list).to.be.an('array'); + + list.forEach(function (lang) { + expect(lang).to.have.property('key'); + expect(lang).to.have.property('label'); + expect(lang.label).to.equal(labels[lang.key]); + }); + }); + }); +});