pr-size-labeler/tests/github_test.sh
Emmanuel Valverde Ramos 54c3c1d940
test: add bashunit (#64)
* chore: add bashunit to the repo

* chore: created folder for test and check that bashunit works

* chore: snapshot for test_should_ignore_files_with_glob

* chore: add pipeline

* chore: snapshot update

* git ignore bashunit, rather install it as vendor

* chore: code style

* chore: fix installed bashunit version

---------

Co-authored-by: Chemaclass <chemaclass@outlook.es>
Co-authored-by: katarn <katarn@katarn.es>
2023-11-14 18:42:54 +01:00

14 lines
396 B
Bash

#!/bin/bash
function set_up() {
source ./src/misc.sh
source ./src/github.sh
}
function test_should_ignore_files_with_glob() {
local -r pr_number=123
local -r files_to_ignore=("*.lock" ".editorconfig")
mock curl cat ./tests/fixtures/test_should_ignore_files_with_regex_response
assert_match_snapshot "$(github::calculate_total_modifications "$pr_number" "${files_to_ignore[*]}")"
}