Skip to content

Commit

Permalink
Added a page-test example
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinHeathman committed Oct 17, 2024
1 parent 374f95c commit 66abfe5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/collect_targets/BUILD.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")

# gazelle:js_root
# gazelle:js_verbose
# gazelle:js_jest_config :jest.config
# gazelle:js_quiet

ts_project(
name = "index",
Expand Down
9 changes: 8 additions & 1 deletion tests/collect_targets/BUILD.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")

# gazelle:js_root
# gazelle:js_verbose
# gazelle:js_jest_config :jest.config
# gazelle:js_quiet

ts_project(
name = "index",
Expand All @@ -11,3 +13,8 @@ ts_project(
"//src/pages2", # keep
],
)

js_library(
name = "jest.config",
srcs = ["jest.config.js"],
)
Empty file.
1 change: 1 addition & 0 deletions tests/collect_targets/src/page-tests/BUILD.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# gazelle:js_collect_all
14 changes: 14 additions & 0 deletions tests/collect_targets/src/page-tests/BUILD.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@rules_jest//jest:defs.bzl", "jest_test")

# gazelle:js_collect_all

jest_test(
name = "page-tests_test",
srcs = ["test.test.ts"],
config = "//:jest.config",
data = [
"//:package_json",
"//src/pages/my_page",
],
deps = ["//src/pages/my_page"],
)
2 changes: 2 additions & 0 deletions tests/collect_targets/src/page-tests/test.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import some_var from 'src/pages/my_page'
var _ = some_var

0 comments on commit 66abfe5

Please sign in to comment.