-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update npm_install/test test to include multiple build files
- Loading branch information
1 parent
0c642ce
commit b1e58c6
Showing
19 changed files
with
314 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
bazel-* | ||
node_modules | ||
internal/npm_install/test/wksp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,29 @@ | ||
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary") | ||
|
||
filegroup( | ||
name = "node_modules", | ||
srcs = glob(["node_modules/**"]), | ||
) | ||
|
||
jasmine_node_test( | ||
name = "test", | ||
srcs = glob(["*.spec.js"]), | ||
data = [ | ||
":BUILD.bazel.golden", | ||
"//internal/npm_install/test/wksp:goldens", | ||
"//internal/npm_install/test/wksp:node_modules", | ||
":check.js", | ||
":node_modules", | ||
":yarn.lock", | ||
], | ||
node_modules = ":node_modules", | ||
node_modules = "//internal/npm_install/test/wksp:node_modules", | ||
deps = ["//internal/npm_install:generate_build_file"], | ||
) | ||
|
||
nodejs_binary( | ||
name = "test.accept", | ||
data = [ | ||
":BUILD.bazel.golden", | ||
"//internal/npm_install/test/wksp:goldens", | ||
"//internal/npm_install/test/wksp:node_modules", | ||
":check.js", | ||
":node_modules", | ||
":update_golden.js", | ||
":yarn.lock", | ||
"//internal/npm_install:generate_build_file", | ||
], | ||
entry_point = "build_bazel_rules_nodejs/internal/npm_install/test/update_golden.js", | ||
install_source_map_support = False, | ||
node_modules = ":node_modules", | ||
node_modules = "//internal/npm_install/test/wksp:node_modules", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const check = require('./check'); | ||
const {check, files} = require('./check'); | ||
|
||
describe('build file generator', () => { | ||
it('should produce a BUILD file from the node_modules file structure', () => { | ||
check(); | ||
it('should produce a BUILD files from the node_modules file structure', () => { | ||
files.forEach(file => check(file)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const check = require('./check'); | ||
const {check, files} = require('./check'); | ||
|
||
check(true); | ||
files.forEach(file => check(file, true)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "node_modules", | ||
srcs = glob(["node_modules/**"]), | ||
) | ||
|
||
filegroup( | ||
name = "goldens", | ||
srcs = glob(["golden/**"]) | ||
) |
6 changes: 6 additions & 0 deletions
6
internal/npm_install/test/wksp/golden/@gregmagolan/BUILD.bazel.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
alias( | ||
name = "@gregmagolan", | ||
actual = "//node_modules/@gregmagolan", | ||
) |
6 changes: 6 additions & 0 deletions
6
internal/npm_install/test/wksp/golden/@gregmagolan/test-a/BUILD.bazel.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
alias( | ||
name = "test-a", | ||
actual = "//node_modules/@gregmagolan/test-a", | ||
) |
6 changes: 6 additions & 0 deletions
6
internal/npm_install/test/wksp/golden/@gregmagolan/test-b/BUILD.bazel.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
alias( | ||
name = "test-b", | ||
actual = "//node_modules/@gregmagolan/test-b", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
internal/npm_install/test/wksp/golden/jasmine/BUILD.bazel.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
alias( | ||
name = "jasmine", | ||
actual = "//node_modules/jasmine", | ||
) | ||
alias( | ||
name = "jasmine__bin", | ||
actual = "//node_modules/jasmine:jasmine__bin", | ||
) |
10 changes: 10 additions & 0 deletions
10
internal/npm_install/test/wksp/golden/node_modules/@gregmagolan/BUILD.bazel.golden
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
internal/npm_install/test/wksp/golden/node_modules/@gregmagolan/test-a/BUILD.bazel.golden
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
internal/npm_install/test/wksp/golden/node_modules/@gregmagolan/test-b/BUILD.bazel.golden
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
internal/npm_install/test/wksp/golden/node_modules/jasmine/BUILD.bazel.golden
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.