apigee-deploy-grunt-plugin

Not applicable

I downloaded the apigee-deploy-grunt-plugin from apigee's github account, but am having trouble running it. Why is the grunt build failing?

ch-nb-1614:apigee-deploy-grunt-plugin jbr$ grunt

Loading "Gruntfile.js" tasks...

ERROR >> Error: Cannot find module 'time-grunt'

Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.

ch-nb-1614:apigee-deploy-grunt-plugin jbr$ npm install npm

WARN URI malformed npm

WARN apigee-deploy-grunt-plugin No description npm

WARN apigee-deploy-grunt-plugin No repository field. npm

WARN apigee-deploy-grunt-plugin No README data npm

WARN apigee-deploy-grunt-plugin No license field.

0 3 342
3 REPLIES 3

Not applicable

Thanks Jason for trying the plugin. Please use the Yeoman API Proxy generador instead of of cloning the repo.

https://github.com/dzuluaga/generator-apigee-deploy-grunt-api#getting-started

the proxy deployment worked, but the mocha tests are failing.

I have a resource of /apigee-deploy-grunt-api-test . is that why the tests are failing?

You should see a folder tests with a bunch of files that contain mocha tests. So, what type of errors are you seeing? if you can see that files tests aren't executed, it's possible that the URL is incorrect or the tests don't match the response as the backend Web service has been changed.

  describe('Check weather in cities', function() {
      async.each(weatherData.simpleWeatherArray() , function(cityData, callback) {
        it('you should be able to get forecast weather for ' + cityData.name + ' from this API Proxy.', function(done) {
           var options = {
                    url: cityData.url, //'https://testmyapi-test.apigee.net/weathergrunt/apigee/forecastrss?w=2502265',
                    headers: {
                      'User-Agent': 'request'
                    }
           }
            request(options, function (error, response, body) {
                expect(body).to.contain(cityData.name) //Sunnyvale, Madrid
                assert.equal(cityData.responseCode, response.statusCode)
                done()
              })
            })
        callback();
    });
  });

If it can't find the files. It's possible that the files aren't found. Check this section of Gruntfile.js to map it to the right files. Try harcoding first and then tweak src attribute.

// Configure a mochaTest task
mochaTest: {
  test: {
    options: {
      reporter: 'spec', //supported reporters: tap
      timeout : 5000,
      quiet: false // Optionally suppress output to standard out (defaults to false)
    },
    src: ["tests/<%= apigee_profiles[grunt.option('env')].apiproxy %>**.js"]
  }
}