sindresorhus/ow

Run tests on the bundled code #24

SamVerschueren posted onGitHub

Currently, the tests are not ran on the bundle we generate. It would be nice if we did this to make sure the bundle we ship works and we didn't forget something in the webpack config for instance.


What problems did you encounter when trying it? I get module not found although it's clearly there.

posted by kevva over 7 years ago

The thing is that running tsc compiles all the code to dist. But, running webpack, only emits one bundle together with the type definitions, no tests are being compiled.

This means that if we run webpack first and then run tsc, the webpack bundle will be overwritten again. This is what I came up with so far

"pretest": "npm run compile && del 'dist/**/*.js' '!dist/test/**/*.js' && webpack"

The only downside is that the code coverage is foobar. Maybe we can fix this by tweaking the webpack config.

posted by SamVerschueren over 7 years ago

@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt

posted by IssueHuntBot about 6 years ago

Ugh, this is what I end up with

image

Probably because the bundle contains all of the node_modules etc.

I still believe this is the best way to test ow to be sure the bundle we ship works. But this looks ugly...

posted by SamVerschueren almost 6 years ago

Alternatively, we could keep the tests as is, and just add one validation test that that bundle works. We don't really need to run all tests on bundle, right?

posted by sindresorhus almost 6 years ago

@sindresorhus has rewarded $18.00 to @sindresorhus. See it on IssueHunt

  • :moneybag: Total deposit: $20.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $2.00
posted by issuehunt-app[bot] over 4 years ago

Fund this Issue

$20.00
Rewarded

Rewarded pull request

Recent activities

sindresorhus was rewarded for sindresorhus/ow# 24
over 4 years ago
sindresorhus submitted an output to  sindresorhus/ ow# 24
over 4 years ago