Skip to content
Browse files

fix(bazel): Set module_name and enable ng test (#27715)

Relative imports in Typescript files only work when module_name is
defined in ts_library (when run in Node.js).
See issue

With that fixed, `ng test` now works.

`ng build` requires `node_modules` to be available in the project
directory, so it's not usable yet. Running `yarn` in project directory
does not work because of postinstall version check.

PR Close #27715
  • Loading branch information...
kyliau authored and mhevery committed Dec 17, 2018
1 parent c986d3d commit 85866defa486471332c089ebfd0f1404df9184ed
@@ -9,15 +9,13 @@ function test() {
# Create project
ng new demo --collection=@angular/bazel --defaults --skip-git
cd demo
# TODO(kyliau): Use bazel commands directly for now. Once 7.1.4 is out we can
# switch to use builders (ng build and ng test)
# Run build
# TODO(kyliau): Use `bazel build` for now. Running `ng build` requires
# node_modules to be available in project directory.
bazel build //src:bundle
# Run test
bazel test \
//src:test \
//e2e:devserver_test \
ng test
ng e2e

@@ -20,6 +20,7 @@ ts_library(
data = [
module_name = "@angular/bazel/src/builders",
deps = [
@@ -12,7 +12,10 @@ ts_library(
data = [


0 comments on commit 85866de

Please sign in to comment.
You can’t perform that action at this time.