xavdid / heroku-config

[Utility] Push and pull heroku environment variables to your local env

Home Page:https://www.npmjs.com/package/heroku-config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test suite fails

aaroncraigongithub opened this issue · comments

I have some legacy apps which have many config variables that are no longer used. I thought a nice feature would be to add a flag to remove unused config variables (that is, config variables that exist on Heroku but that do not exist in the local .env file) when doing a push command.

I forked the repo to create a PR for this, but upon running the test suite, I get an error. Before moving forward, I wanted to check to see if the test suite is current and if this is indicating some config issue on my end.

The output of npm test is:

$ npm test

> heroku-config@1.2.0 test /Users/aaron/Documents/projects/heroku-config
> mocha test.js && standard

/Users/aaron/Documents/projects/heroku-config/node_modules/heroku-cli-util/lib/action.js:16
  if (options.then) [options, promise] = [{}, options]
                    ^^^^^^^^^^^^^^^^^^

ReferenceError: Invalid left-hand side in assignment
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/aaron/Documents/projects/heroku-config/node_modules/heroku-cli-util/index.js:11:18)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/aaron/Documents/projects/heroku-config/test.js:20:13)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at /Users/aaron/Documents/projects/heroku-config/node_modules/mocha/lib/mocha.js:222:27
    at Array.forEach (native)
    at Mocha.loadFiles (/Users/aaron/Documents/projects/heroku-config/node_modules/mocha/lib/mocha.js:219:14)
    at Mocha.run (/Users/aaron/Documents/projects/heroku-config/node_modules/mocha/lib/mocha.js:487:10)
    at Object.<anonymous> (/Users/aaron/Documents/projects/heroku-config/node_modules/mocha/bin/_mocha:458:18)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:148:18)
    at node.js:405:3
npm ERR! Test failed.  See above for more details.

I've gone ahead and done the PR (#8) without adding any tests. Feel free to ask for tests if you think they are necessary.

That's a node version error. Plug-ins always run on a recent version. It's currently on 6.2.1 (per this), and I believe the cli doesn't run on its own if you're under 6.0 (since it uses ES6 assignments).

Yep, upgraded and now it passes. I'll write tests for my PR tomorrow.

Awesome! Looking forward to it