Skip to content

Commit 1a41ea8

Browse files
authored
Include .ts files with source maps (#14)
* Include .ts files with source maps * Try appending to `js` array rather than `js_outputs` * Try restricting Jest to .js and .json files * Fix lint
1 parent ac732f5 commit 1a41ea8

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

test/src/jest-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export function jestConfig() {
22
return {
3+
moduleFileExtensions: ["js", "json"],
34
modulePathIgnorePatterns: [`${process.env.JEST_ROOT}/bazel/`],
45
testPathIgnorePatterns: [`${process.env.JEST_ROOT}/bazel/`],
56
testTimeout: 60 * 1000,

ts-proto/rules.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ def _ts_proto_libraries_impl(ctx):
189189
js.append(map)
190190
js_outputs.append(map)
191191

192+
# Include .ts file with source map. Used by VSCode debugger as
193+
# well as Istanbul's code coverage reports (interactive HTML).
194+
js.append(ts_)
195+
192196
path = file.path[len(lib.path + "/"):]
193197
if declaration_prefix:
194198
path = "%s/%s" % (declaration_prefix, path)

typescript/rules.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ def _ts_library_impl(ctx):
245245
map = actions.declare_file(map_path(js_path(js_path_, jsx)))
246246
js.append(map)
247247
js_outputs.append(map)
248+
249+
# Include .ts file with source map. Used by VSCode debugger
250+
# as well as Istanbul's code coverage reports (interactive
251+
# HTML).
252+
js.append(ts_)
253+
248254
declaration = actions.declare_file(declaration_path(declaration_path_))
249255
declarations.append(declaration)
250256
outputs.append(declaration)

0 commit comments

Comments
 (0)