install-test.js 526 B

123456789101112131415161718192021222324
  1. // npm install-test
  2. // Runs `npm install` and then runs `npm test`
  3. const Install = require('./install.js')
  4. class InstallTest extends Install {
  5. static get description () {
  6. return 'Install package(s) and run tests'
  7. }
  8. /* istanbul ignore next - see test/lib/load-all-commands.js */
  9. static get name () {
  10. return 'install-test'
  11. }
  12. exec (args, cb) {
  13. this.npm.commands.install(args, (er) => {
  14. if (er)
  15. return cb(er)
  16. this.npm.commands.test([], cb)
  17. })
  18. }
  19. }
  20. module.exports = InstallTest