Skip to content

Commit e3209ac

Browse files
committed
chore: Add Makefiles for dev-packages to make it convenient to run tests
You can now run specific e2e, browser-integration, node-integration and node-core-integration tests by using `make` inside `dev-packages`. Select the suite and you'll be given a fuzzy search prompt that you can type in to filter or use arrow keys to select the test you want to run. This is for running specific tests/test-apps.
1 parent b37fa88 commit e3209ac

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

dev-packages/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.PHONY: run browser node node-core e2e
2+
3+
# Fuzzy-pick which test suite to run, then fuzzy-pick a test within it
4+
run:
5+
@if ! command -v fzf &> /dev/null; then \
6+
echo "Error: fzf is required. Install with: brew install fzf"; \
7+
exit 1; \
8+
fi
9+
@suite=$$(echo "browser-integration-tests\nnode-integration-tests\nnode-core-integration-tests\ne2e-tests" | \
10+
fzf --height=10 --layout=reverse --border=rounded --margin=1.5% \
11+
--color=dark --prompt="run test suite: "); \
12+
[ -n "$$suite" ] && $(MAKE) -C $$suite run
13+
14+
# Run directly in a specific suite
15+
browser:
16+
@$(MAKE) -C browser-integration-tests run
17+
18+
node:
19+
@$(MAKE) -C node-integration-tests run
20+
21+
node-core:
22+
@$(MAKE) -C node-core-integration-tests run
23+
24+
e2e:
25+
@$(MAKE) -C e2e-tests run
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: run
2+
3+
run:
4+
@if ! command -v fzf &> /dev/null; then \
5+
echo "Error: fzf is required. Install with: brew install fzf"; \
6+
exit 1; \
7+
fi
8+
@find . -name test.ts | sed -e 's|^\./suites/||' -e 's|/test\.ts$$||' | fzf --height=10 --layout=reverse --border=rounded --margin=1.5% --color=dark --prompt="yarn test " | xargs -r yarn test
9+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: run
2+
3+
run:
4+
@if ! command -v fzf &> /dev/null; then \
5+
echo "Error: fzf is required. Install with: brew install fzf"; \
6+
exit 1; \
7+
fi
8+
@find . -name test.ts | sed -e 's|^\./suites/||' -e 's|/test\.ts$$||' | fzf --height=10 --layout=reverse --border=rounded --margin=1.5% --color=dark --prompt="yarn test " | xargs -r yarn test
9+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: run
2+
3+
run:
4+
@if ! command -v fzf &> /dev/null; then \
5+
echo "Error: fzf is required. Install with: brew install fzf"; \
6+
exit 1; \
7+
fi
8+
@find . -name test.ts | sed -e 's|^\./suites/||' -e 's|/test\.ts$$||' | fzf --height=10 --layout=reverse --border=rounded --margin=1.5% --color=dark --prompt="yarn test " | xargs -r yarn test
9+

0 commit comments

Comments
 (0)