aboutsummaryrefslogtreecommitdiffstats
path: root/tests/setup.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-11-23 18:32:47 -0800
committerEugene Triguba <hello@eugenetriguba.com>2026-11-26 20:21:16 -0800
commit78c397c3f7a9eea0f764c66270f47613f8e015d3 (patch)
treeebaa4d1bcf595719c55167deadd7847452ebedfe /tests/setup.sh
parentFix format of installation config in readme file (diff)
downloadtmux-toggle-term-78c397c3f7a9eea0f764c66270f47613f8e015d3.zip
Refactor bats tests
Diffstat (limited to 'tests/setup.sh')
-rw-r--r--tests/setup.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/setup.sh b/tests/setup.sh
new file mode 100644
index 0000000..2cd3baa
--- /dev/null
+++ b/tests/setup.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bats
+
+load '../vendor/bats-support/load'
+load '../vendor/bats-assert/load'
+load 'tmux.sh'
+
+setup() {
+ export TMUX_SOCKET="test$$"
+ export TMUX_CONFIG_PATH="$TMUX_CONFIG_PATH"
+ export TEST_SESSION="test-$BATS_TEST_NUMBER-$$"
+ tmux_new_session "$TEST_SESSION"
+}
+
+teardown() {
+ tmux_kill_server
+ unset TMUX_SOCKET TMUX_CONFIG_PATH TEST_SESSION
+}