Skip to content

[JavaScript] undefined 'pet' variable in tests #4608

@davidteixeira

Description

@davidteixeira
Description

When generating a JavaScript client from swagger.yml file, all tests include the 'pet' variable, which is not defined anywhere in the project. This results in a Reference Error when testing:
ReferenceError: pet is not defined

Swagger-codegen version

I am using the latest swagger-codegen version.

Swagger declaration file content or url
describe('UsersApi', function() {
describe('usersGet', function() {
  it('should call usersGet successfully', function(done) {
    //uncomment below and update the code to test usersGet
    instance.usersGet(pet, function(error) {
      if (error) throw error;
    expect().to.be();
    });
    done();
  });
});
Command line used for generation

npm start -- (./node_modules/mocha/bin/mocha --recursive)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions