Skip to content

Commit

Permalink
test(cli): data files in non-generated BUILD files (#7058)
Browse files Browse the repository at this point in the history
Various test cases trying to reproduce a customer issue.

---

### Changes are visible to end-users: no

### Test plan

- New test cases added

GitOrigin-RevId: 382be45c9eaaac2578d8a85cc7df89a4f564a3f1
  • Loading branch information
jbedard committed Oct 23, 2024
1 parent ae3e4e0 commit fdbbb64
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 2 deletions.
5 changes: 4 additions & 1 deletion gazelle/js/tests/simple_import_disabled/BUILD.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
ts_project(
name = "simple_import_disabled",
srcs = ["main.ts"],
deps = ["//disabled:lib"],
deps = [
"//disabled:data",
"//disabled:lib",
],
)
19 changes: 19 additions & 0 deletions gazelle/js/tests/simple_import_disabled/disabled/BUILD.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#gazelle:js disabled

load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")

ts_project(
name = "lib",
srcs = glob(["**/*.ts"]),
)

js_library(
name = "unknown-data-types",
srcs = glob(["**/*.yaml"]),
)

js_library(
name = "empty-glob",
srcs = glob(
["**/*.does-not-exist"],
allow_empty = True,
),
)

js_library(
name = "data",
srcs = glob(["data/*.json"]),
)
19 changes: 19 additions & 0 deletions gazelle/js/tests/simple_import_disabled/disabled/BUILD.out
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#gazelle:js disabled

load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")

ts_project(
name = "lib",
srcs = glob(["**/*.ts"]),
)

js_library(
name = "unknown-data-types",
srcs = glob(["**/*.yaml"]),
)

js_library(
name = "empty-glob",
srcs = glob(
["**/*.does-not-exist"],
allow_empty = True,
),
)

js_library(
name = "data",
srcs = glob(["data/*.json"]),
)
Empty file.
Empty file.
Empty file.
3 changes: 2 additions & 1 deletion gazelle/js/tests/simple_import_disabled/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as a from './disabled/a';
import * as b from './disabled/sub1/b';
import c from './disabled/data/c.json'

console.log(a, b);
console.log(a, b, c);

0 comments on commit fdbbb64

Please sign in to comment.