Skip to content

Conversation

@rorticus
Copy link
Contributor

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code has been formatted with prettier
  • Unit or Functional tests are included in the PR

Description:

Adding a glob to discover .spec.ts and .spec.tsx files in the source directory and include them in unit test builds.

There are currently not tests for test builds, so I didn't add anything, but I manually tested this by adding a test.spec.ts in the test-app/src directory and did a unit test build. I then manually verified that the test was included in the built bundle.

Resolves #341

@rorticus rorticus requested review from agubler and matt-gadd October 25, 2019 13:23
@codecov
Copy link

codecov bot commented Oct 25, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #342   +/-   ##
=======================================
  Coverage   48.53%   48.53%           
=======================================
  Files          10       10           
  Lines         684      684           
  Branches      193      193           
=======================================
  Hits          332      332           
  Misses        352      352
Impacted Files Coverage Δ
src/unit.config.ts 30% <ø> (ø) ⬆️

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 1b85b0d...e0e90a5. Read the comment docs.

config.entry = () => {
const unit = globby
.sync([`${basePath}/tests/unit/**/*.ts`])
.sync([`${basePath}/tests/unit/**/*.ts`, `${basePath}/src/**/*.spec.{ts,tsx}`])
Copy link
Member

Choose a reason for hiding this comment

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

Should the other glob also include tsx? I know it's not part of these changes tho!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can get behind that change! Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discover spec files as well as tests in the test folder

3 participants