unorm icon indicating copy to clipboard operation
unorm copied to clipboard

npm ignoring tests means `npm run unorm test` doesn't work

Open ljharb opened this issue 10 years ago • 4 comments

I'd like to include unorm in a module, and use npm run unorm test to run the tests, but none of the tests are included in npm.

ljharb avatar Jun 30 '14 18:06 ljharb

Shortly, why?

We omit tests from published package, as they are development-related code. And Travis makes sure that we never release broken package.

phadej avatar Jun 30 '14 19:06 phadej

My module will combine multiple shim modules, including unorm - globals will be modified, and I want to make sure that unorm's tests aren't broken by another module's global changes.

The only way I can avoid running unorm's tests via npm, is by duplicating them myself.

ljharb avatar Jul 02 '14 07:07 ljharb

That one is very exoteric usage need. I'd like keep package size small for every user.

You could pull this repository as submodule if you need the tests from here.

AFAIK you have to monkey patch test suite anyway, as unorm's test-suite uses local instance of unorm - there aren't other packages messing up with globals. Or did I get it wrong?

@walling What you think about this?

phadej avatar Jul 02 '14 07:07 phadej

It's typical for npm modules to include their tests. Reducing package size is the job of a deploy process, not npm.

ljharb avatar Jul 02 '14 08:07 ljharb