summaryrefslogtreecommitdiff
path: root/tools/ts_library_builder/test.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-11-04 10:45:06 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-11-04 05:56:49 -0800
commit765f229357587fb66dfe04d3c48d62c6aae9ce71 (patch)
treee309a1c918cf416d7e8c3de2cb16c14f737e6c20 /tools/ts_library_builder/test.ts
parent2cf3a89f63c7bc7cfd9404f779b796c29c8e9598 (diff)
Improve robustness of lib builder.
Diffstat (limited to 'tools/ts_library_builder/test.ts')
-rw-r--r--tools/ts_library_builder/test.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/ts_library_builder/test.ts b/tools/ts_library_builder/test.ts
index 70b6145eb..3a18fe29c 100644
--- a/tools/ts_library_builder/test.ts
+++ b/tools/ts_library_builder/test.ts
@@ -128,7 +128,10 @@ test(function buildLibraryMerge() {
});
assert(targetSourceFile.getNamespace("moduleC") != null);
- assertEqual(targetSourceFile.getNamespaces().length, 1);
+ assert(targetSourceFile.getNamespace("moduleD") != null);
+ assert(targetSourceFile.getNamespace("moduleE") != null);
+ assert(targetSourceFile.getNamespace("moduleF") != null);
+ assertEqual(targetSourceFile.getNamespaces().length, 4);
assert(targetSourceFile.getInterface("FooBar") != null);
assertEqual(targetSourceFile.getInterfaces().length, 1);
const variableDeclarations = targetSourceFile.getVariableDeclarations();
@@ -138,7 +141,15 @@ test(function buildLibraryMerge() {
variableDeclarations[2].getType().getText(),
`typeof moduleC.qat`
);
- assertEqual(variableDeclarations.length, 3);
+ assertEqual(
+ variableDeclarations[3].getType().getText(),
+ `typeof moduleE.process`
+ );
+ assertEqual(
+ variableDeclarations[4].getType().getText(),
+ `typeof moduleD.reprocess`
+ );
+ assertEqual(variableDeclarations.length, 5);
});
// TODO author unit tests for `ast_util.ts`