|
| 1 | +# Copyright 2017 The Bazel Authors. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +licenses(["notice"]) # Apache 2.0 |
| 16 | + |
| 17 | +load("//internal:defaults.bzl", "ts_library") |
| 18 | + |
| 19 | + |
| 20 | +error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" |
| 21 | + |
| 22 | +ts_library( |
| 23 | + name = "no_expected_diagnostics_test", |
| 24 | + testonly = 1, |
| 25 | + srcs = ["no_expected_diagnostics.ts"], |
| 26 | + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", |
| 27 | +) |
| 28 | + |
| 29 | +ts_library( |
| 30 | + name = "expected_diagnostics_test", |
| 31 | + testonly = 1, |
| 32 | + srcs = ["expected_diagnostics.ts"], |
| 33 | + expected_diagnostics = [ |
| 34 | + "\(6,1\).*" + error_message, |
| 35 | + "\(8,1\).*" + error_message, |
| 36 | + "\(12,1\).*" + error_message, |
| 37 | + "\(16,1\).*" + error_message, |
| 38 | + "\(19,1\).*" + error_message, |
| 39 | + ], |
| 40 | + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", |
| 41 | +) |
| 42 | + |
| 43 | +ts_library( |
| 44 | + name = "user_defined_check_return_value", |
| 45 | + testonly = 1, |
| 46 | + srcs = ["user_defined_check_return_value.ts"], |
| 47 | + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", |
| 48 | +) |
| 49 | + |
| 50 | +ts_library( |
| 51 | + name = "unused_return_value_user_defined_function", |
| 52 | + testonly = 1, |
| 53 | + srcs = ["unused_return_value_user_defined_function.ts"], |
| 54 | + expected_diagnostics = [ |
| 55 | + "\(4,1\).*" + error_message, |
| 56 | + "\(5,1\).*" + error_message, |
| 57 | + "\(7,1\).*" + error_message, |
| 58 | + "\(9,1\).*" + error_message, |
| 59 | + "\(15,1\).*" + error_message, |
| 60 | + "\(16,1\).*" + error_message, |
| 61 | + ], |
| 62 | + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", |
| 63 | + deps = [ |
| 64 | + ":user_defined_check_return_value", |
| 65 | + "@npm//@types/jasmine", |
| 66 | + ], |
| 67 | +) |
0 commit comments