| # Copyright 2017 The Bazel Authors. All rights reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| load("@build_bazel_rules_nodejs//internal/npm_install:npm_umd_bundle.bzl", "npm_umd_bundle") |
| load("@npm//@bazel/concatjs:index.bzl", "concatjs_devserver", "ts_library") |
| load("@npm//@bazel/protractor:index.bzl", "protractor_web_test_suite") |
| |
| exports_files([ |
| "red-body-style.css", |
| "tsconfig.json", |
| "protractor.on-prepare.js", |
| ]) |
| |
| ts_library( |
| name = "app", |
| srcs = ["app.ts"], |
| deps = [ |
| "@npm//date-fns", |
| "@npm//rxjs", |
| "@npm//typeorm", |
| ], |
| ) |
| |
| # typeorm is a special case for npm_umd_bundle as we need to excluded |
| # the `react-native-sqlite-storage` dynamic require from the umd bundle |
| npm_umd_bundle( |
| name = "typeorm_umd", |
| package_name = "typeorm", |
| entry_point = "@npm//:node_modules/typeorm/browser/index.js", |
| excluded = ["react-native-sqlite-storage"], |
| package = "@npm//typeorm", |
| ) |
| |
| concatjs_devserver( |
| name = "devserver", |
| entry_module = "e2e_concatjs_devserver/app", |
| scripts = [ |
| "@npm//date-fns:date-fns.umd.js", |
| "@npm//rxjs:rxjs.umd.js", |
| ":typeorm.umd.js", |
| ], |
| # We'll collect all the devmode JS sources from these TypeScript libraries |
| deps = [":app"], |
| ) |
| |
| ts_library( |
| name = "e2e", |
| testonly = 1, |
| srcs = ["app_e2e-spec.ts"], |
| deps = [ |
| "@npm//@types/jasmine", |
| "@npm//@types/node", |
| "@npm//protractor", |
| ], |
| ) |
| |
| protractor_web_test_suite( |
| name = "devserver_test", |
| on_prepare = ":protractor.on-prepare.js", |
| server = ":devserver", |
| deps = [":e2e"], |
| ) |
| |
| # Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test |
| sh_test( |
| name = "dummy_test", |
| srcs = ["dummy_test.sh"], |
| ) |