Skip to content

Commit

Permalink
test(typescript): remove source and declaration maps from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Jul 17, 2020
1 parent cf8b106 commit 8c7eeee
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/typescript/internal/ts_project.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _ts_project_impl(ctx):
if ctx.outputs.buildinfo_out:
outputs.append(ctx.outputs.buildinfo_out)
runtime_outputs = depset(json_outs + ctx.outputs.js_outs + ctx.outputs.map_outs)
typings_outputs = ctx.outputs.typings_outs + ctx.outputs.typing_maps_outs + [s for s in ctx.files.srcs if s.path.endswith(".d.ts")]
typings_outputs = ctx.outputs.typings_outs + [s for s in ctx.files.srcs if s.path.endswith(".d.ts")]

if len(outputs) > 0:
run_node(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ ts_project(
name = "tsconfig",
srcs = SRCS,
declaration = True,
declaration_map = True,
outdir = "out",
rootdir = "subdir",
source_map = True,
)

filegroup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"compilerOptions": {
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"types": []
}
}
6 changes: 2 additions & 4 deletions packages/typescript/test/ts_project/declarationdir/verify.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const assert = require('assert');

const types_files = process.argv.slice(2, 4);
const code_files = process.argv.slice(4, 6);
const types_files = process.argv.slice(2, 3);
const code_files = process.argv.slice(3, 4);
assert.ok(types_files.some(f => f.endsWith('declarationdir/out/a.d.ts')), 'Missing a.d.ts');
assert.ok(types_files.some(f => f.endsWith('declarationdir/out/a.d.ts.map')), 'Missing a.d.ts.map');
assert.ok(code_files.some(f => f.endsWith('declarationdir/out/a.js')), 'Missing a.js');
assert.ok(code_files.some(f => f.endsWith('declarationdir/out/a.js.map')), 'Missing a.js.map');
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ ts_project(
name = "tsconfig",
srcs = SRCS,
declaration = True,
declaration_map = True,
declarationdir = "out/types",
outdir = "out/code",
rootdir = "subdir",
source_map = True,
)

filegroup(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"compilerOptions": {
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"types": []
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
const assert = require('assert');

const types_files = process.argv.slice(2, 4);
const code_files = process.argv.slice(4, 6);
const types_files = process.argv.slice(2, 3);
const code_files = process.argv.slice(3, 4);
assert.ok(
types_files.some(f => f.endsWith('declarationdir_with_value/out/types/a.d.ts')),
'Missing a.d.ts');
assert.ok(
types_files.some(f => f.endsWith('declarationdir_with_value/out/types/a.d.ts.map')),
'Missing a.d.ts.map');
assert.ok(
code_files.some(f => f.endsWith('declarationdir_with_value/out/code/a.js')), 'Missing a.js');
assert.ok(
code_files.some(f => f.endsWith('declarationdir_with_value/out/code/a.js.map')),
'Missing a.js.map');

0 comments on commit 8c7eeee

Please sign in to comment.