Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Remove mocha type reference in @opencensus/core release code #254

Merged
merged 5 commits into from
Jan 8, 2019

Conversation

draffensperger
Copy link
Contributor

The generated code in build/src/trace/model/tracer.d.ts and build/src/trace/model/types.d.ts includes a line /// <reference types="mocha" />. I believe that's because TypeScript sees that the NodeJS.EventEmitter type is not defined in the file and so it pulls in the included global types, including the Mocha types. That means that when @opencensus/core is imported into another TypeScript NPM module, it needs to bring in the @types/mocha package in order to compile.

This fixes that by separating out the test and release compilation steps and having two separate tsconfig files with different types definitions. As a side benefit, this also means that npm run prepare will fail if any code in the src folder accidentally references any Mocha types.

@codecov-io
Copy link

codecov-io commented Dec 21, 2018

Codecov Report

Merging #254 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #254   +/-   ##
=======================================
  Coverage   94.61%   94.61%           
=======================================
  Files         101      101           
  Lines        7312     7312           
  Branches      690      690           
=======================================
  Hits         6918     6918           
  Misses        394      394

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5c1c4c...3968940. Read the comment docs.

@draffensperger
Copy link
Contributor Author

This will enable use of Jasmine for unit tests in the opencensus-web project that I'm thinking will make use of the TypeScript interfaces from @opencensus/core. See census-instrumentation/opencensus-web#2

Copy link
Contributor

@justindsmith justindsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mayurkale22 mayurkale22 merged commit fa325f1 into master Jan 8, 2019
@mayurkale22 mayurkale22 deleted the remove-dts-mocha-ref branch January 8, 2019 01:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants