diff --git a/.github/workflows/samples-javascript.yaml b/.github/workflows/samples-javascript.yaml new file mode 100644 index 000000000000..bef859e1b576 --- /dev/null +++ b/.github/workflows/samples-javascript.yaml @@ -0,0 +1,51 @@ +name: Samples JS clients + +on: + push: + paths: + #- samples/client/petstore/javascript-flowtyped/** + - samples/client/petstore/javascript-es6/** + - samples/client/petstore/javascript-promise-es6/** + pull_request: + paths: + #- samples/client/petstore/javascript-flowtyped/** + - samples/client/petstore/javascript-es6/** + - samples/client/petstore/javascript-promise-es6/** +jobs: + build: + name: Build projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: + - "18.x" + - "20.x" + sample: + # clients + - samples/client/petstore/javascript-es6/ + - samples/client/petstore/javascript-promise-es6/ + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + steps: + - uses: actions/checkout@v5 + - name: Add hosts to /etc/hosts + run: | + sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'npm' # Or 'yarn' + - name: npm install + working-directory: ${{ matrix.sample }} + run: npm install + - name: npm test + working-directory: ${{ matrix.sample }} + run: npm test diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 58c1584b99b7..842c43f3ee98 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -107,9 +107,6 @@ elif [ "$NODE_INDEX" = "3" ]; then (cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test) (cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test) (cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test) - (cd samples/client/petstore/javascript-flowtyped && mvn integration-test) - (cd samples/client/petstore/javascript-es6 && mvn integration-test) - (cd samples/client/petstore/javascript-promise-es6 && mvn integration-test) (cd samples/server/petstore/typescript-nestjs-server && mvn integration-test) else diff --git a/samples/client/petstore/javascript-es6/.openapi-generator-ignore b/samples/client/petstore/javascript-es6/.openapi-generator-ignore index 7484ee590a38..c5b04829c20a 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator-ignore +++ b/samples/client/petstore/javascript-es6/.openapi-generator-ignore @@ -21,3 +21,6 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +# +# +# diff --git a/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js b/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js deleted file mode 100644 index 25d9ecd929f0..000000000000 --- a/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', process.cwd()+'/src/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.OpenApiPetstore); - } -}(this, function(expect, OpenApiPetstore) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new OpenApiPetstore.HealthCheckResult(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('HealthCheckResult', function() { - it('should create an instance of HealthCheckResult', function() { - // uncomment below and update the code to test HealthCheckResult - //var instance = new OpenApiPetstore.HealthCheckResult(); - //expect(instance).to.be.a(OpenApiPetstore.HealthCheckResult); - }); - - it('should have the property nullableMessage (base name: "NullableMessage")', function() { - // uncomment below and update the code to test the property nullableMessage - //var instance = new OpenApiPetstore.HealthCheckResult(); - //expect(instance).to.be(); - }); - - }); - -}));