0.1.1 • Published 9 years ago

grunt-npm-update-test v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

grunt-npm-update-test

A Grunt Task for automatically updating NPM modules and running tests to catch regressions.

This is extremely helpful when updating a huge number of packages at once, since it makes tracking down regressions a lot faster.

grunt-npm-update-test is developed and maintained by grandcentrix GmbH, you can reach us on Twitter #grandcentrix.

Configuration

grunt.initConfig({

    npmUpdateTest: {
        options: {

            // Package JSON
            pgk: grunt.file.readJSON('package.json'),

            // Task to run after each module update to verify the functionality
            task: 'mocha:test',

            // Which version that available via NPM to install
            version: 'wanted' // either 'wanted' (default) or 'latest'

        }
    }

});

How it works

  1. Fetches update information for all local modules via npm outdated
  2. For each outdated module:

  3. Installs the wanted / latest version

  4. Runs the test task specified in the configuration options
    • If the tests succeed, saves the wanted / latest version and continues with the next module
    • If the tests fail, rolls back to the current version and continues with the next module

Example

Belows an example of how it looks if everything went smoothly:

Running "npmUpdateTest" task
>> Fetching module version information...
>> Found 1 module(s) that need to be updated...
>> Updating "pg" from 3.6.2 to 4.2.0... (1 out of 1)

All modules have been updated.

Done, without errors.

In case of failed updates, the output we'll look like this:

Running "npmUpdateTest" task
>> Fetching module version information...
>> Found 1 module(s) that need to be updated...
>> Updating "influx" from 3.0.0 to 3.3.0... (1 out of 1)
>> Tests failed for influx@3.3.0

0 module(s) have been updated, but 1 have failed and need a manual update:

  Package      Current     Latest
  -------      -------     ------

  influx       3.0.0       3.3.0

Warning: Incomplete module updates. Use --force to continue.

Aborted due to warnings.

Contributors

License

Copyright (c) 2015 grandcentrix GmbH, Ivo Wetzel.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.1.1

9 years ago

0.1.0

9 years ago