Skip to content

Commit a22f587

Browse files
committed
test: tighten node_10_spec EOL warning assertion to match full message
1 parent ba67ede commit a22f587

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

spec/ci/node_10_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88

99
it "should deploy successfully with EOL warning" do
1010
app.deploy do |app|
11-
expect(app.output).to include("End-of-Life")
11+
expect(clean_output(app.output)).to include(<<~OUTPUT)
12+
remote: ! Node.js 10.24.1 is now End-of-Life (EOL). It no longer receives security
13+
remote: ! updates, bug fixes, or support from the Node.js project and is no longer
14+
remote: ! supported on Heroku.
15+
remote: !
16+
remote: ! In a future buildpack release, this warning will become a build error. Please
17+
remote: ! upgrade to a supported version as soon as possible to avoid build failures.
18+
remote: !
19+
remote: ! https://devcenter.heroku.com/articles/nodejs-support#supported-node-js-versions
20+
OUTPUT
1221
expect(successful_body(app).strip).to eq("Hello, world!")
1322
end
1423
end

spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ def successful_json_body(app, options = {})
4242
JSON.parse(body)
4343
end
4444

45+
def clean_output(output)
46+
output
47+
.gsub(/\e\[[0-9;]+m/, '')
48+
.gsub(/ {8}(?=\R)/, '')
49+
end
50+
4551
def run!(cmd)
4652
out = `#{cmd}`
4753
raise "Error running command #{cmd.inspect}: #{out}" unless $?.success?

0 commit comments

Comments
 (0)