Skip to content

Commit

Permalink
load coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelahman authored and filmil committed Nov 24, 2021
1 parent 881d221 commit b976148
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
load("@bazel_bats//:rules.bzl", "bats_test")

sh_library(
name = "helper",
srcs = ["helper.bash"],
)

bats_test(
name = "hello_world_load_test",
srcs = ["hello_world_load.bats"],
deps = [":helper"],
)

bats_test(
name = "hello_world_test",
srcs = ["hello_world.bats"],
Expand Down
9 changes: 9 additions & 0 deletions tests/hello_world_load.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bats

load "helper"

@test "can run function from loaded library" {
run echo4
[ $status -eq 0 ]
[ "$output" == "4" ]
}
5 changes: 5 additions & 0 deletions tests/helper.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

function echo4() {
echo "4"
}

0 comments on commit b976148

Please sign in to comment.