Skip to content

Instantly share code, notes, and snippets.

@Qard
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qard/a1242969d8c60fa4197e to your computer and use it in GitHub Desktop.
Save Qard/a1242969d8c60fa4197e to your computer and use it in GitHub Desktop.
run `npm test` against every node version! (requires nvm and ruby)
require 'openssl'
require 'net/http'
uri = URI.parse("https://semver.io/node/versions")
# uri = URI.parse("https://semver.io/iojs/versions")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # read into this
result = http.get(uri.request_uri)
versions = result.body.split("\n").map(&:strip).reverse
versions.each do |version|
puts "=============================================="
output = `. $NVM_DIR/nvm.sh && nvm install #{version} && rm -rf node_modules && npm install 2>&1 && npm test 2>&1`
#output = `. $NVM_DIR/nvm.sh && nvm install iojs-#{version} && rm -rf node_modules && npm install 2>&1 && npm test 2>&1`
if $? != 0
puts(version + ' does not work')
puts output
else
puts version + ' works'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment