Skip to content

Commit

Permalink
Merge pull request #202084 from branchvincent/standard
Browse files Browse the repository at this point in the history
standard: add head
  • Loading branch information
BrewTestBot authored Dec 22, 2024
2 parents 8e35597 + 3384f90 commit 78dca4c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Formula/s/standard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Standard < Formula
url "https://registry.npmjs.org/standard/-/standard-17.1.2.tgz"
sha256 "fb2aaf22460bb3e77e090c727c694a56dd9a9486eec30a0152290a5c6d83757c"
license "MIT"
head "https://github.com/standard/standard.git", branch: "master"

bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "d20e97c6540bd3307d244952e9a90986e43b5c11821d88941238a06592dfb422"
Expand All @@ -18,18 +19,16 @@ class Standard < Formula

def install
system "npm", "install", *std_npm_args
bin.install_symlink Dir["#{libexec}/bin/*"]
bin.install_symlink libexec.glob("bin/*")
end

test do
test_foo = testpath/"foo.js"
test_foo.write "console.log(\"hello there\")"
output = shell_output("#{bin}/standard #{test_foo} 2>&1", 1)
(testpath/"foo.js").write <<~JS
console.log("hello there")
if (name != 'John') { }
JS
output = shell_output("#{bin}/standard foo.js 2>&1", 1)
assert_match "Strings must use singlequote. (quotes)", output

test_bar = testpath/"bar.js"
test_bar.write "if (name != 'John') { }"
output = shell_output("#{bin}/standard #{test_bar} 2>&1", 1)
assert_match "Expected '!==' and instead saw '!='. (eqeqeq)", output
assert_match "Empty block statement. (no-empty)", output

Expand Down

0 comments on commit 78dca4c

Please sign in to comment.