2

I'm working on converting a Node.js library to use Bazel as the build system. So far I have managed to get my TS rules and a basic Jest test execution to work. You can my setup here:

https://github.com/lqc/bazel-examples/tree/master/nodejs_typescript_runnable

So running bazel test //app:test gives me a proper Junit report in bazel-testlogs.

Running bazel coverage //app:test runs the tests, but doesn't produce the LCOV report I would expect.

As far as I could tell, Bazel uses the C8 NPM package to enable the built-in coverage functionality in V8 (I had to add it to my dependencies). At the same time, Jest also has the option to use V8 as a coverage provider.

Should I configure this in Jest? Disable it in Jest? I would be totally fine with configuring this in Jest, but I don't see a way to disable the logic in Bazel around it.

lqc
  • 7,434
  • 1
  • 25
  • 25

1 Answers1

-2

I am sure you have forgotten to commit something , because of closing braces. Check below patch

--- a/nodejs_typescript_runnable/app/tests/some.spec.ts
+++ b/nodejs_typescript_runnable/app/tests/some.spec.ts
@@ -5,5 +5,5 @@ describe("Test suite", () => {
         run();
         expect(true).toBeTruthy();
-    });
+    })});

Just one question, how can we add a single npm package (no further dependencies) to this project

kiran
  • 1
  • 1
  • Just cut one line too much when cleaning it up from private repo. Fixed now, but it doesn't matter. I'm not sure how the dependency question is relevant to my problem (or why would you not want transitive dependencies). – lqc Sep 10 '21 at 15:11