Last active
August 29, 2015 14:14
-
-
Save Qard/a1242969d8c60fa4197e to your computer and use it in GitHub Desktop.
run `npm test` against every node version! (requires nvm and ruby)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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