Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default Node.js version to 'lts/*' #1747

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/travis/build/script/node_js.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ module Travis
module Build
class Script
class NodeJs < Script
DEFAULT_VERSION = '0.10'
DEFAULTS = {
node_js: '0.10',
}

DEPRECATIONS = [
{
name: 'Node.js',
current_default: '0.10',
new_default: 'lts/*',
cutoff_date: '2019-09-01',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’d be great if you could delay this, pending lts/-2 being available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. This date is completely arbitrary.

}
]

YARN_REQUIRED_NODE_VERSION = '4'

Expand Down Expand Up @@ -126,7 +137,7 @@ def version
end

def node_js_given_in_config?
!!config[:node_js]
!data.language_default_p
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/travis/build/script/node_js/manager/nvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def use_default
install_version '$(< .nvmrc)'
end
sh.else do
install_version Travis::Build::Script::NodeJs::DEFAULT_VERSION
install_version version
end
end

Expand Down
8 changes: 8 additions & 0 deletions spec/build/script/node_js_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,13 @@
expect(subject).to include_sexp [:cmd, "nvs add 0.10", assert: true, echo: true, timing: true]
end
end

context 'when no node_js version is given' do
let(:config) { {} }

it "installs 0.10" do
expect(subject).to include_sexp [:cmd, "nvs add 0.10", assert: true, echo: true, timing: true]
end
end
end
end