Giter Site home page Giter Site logo

Comments (9)

indexzero avatar indexzero commented on July 19, 2024

So I've changed the default way that tests are suggested to be run in this commit: ab13aad

Try this:

  cd path/to/api-easy
  npm uninstall vows -g
  npm install
  npm test

The npm test command will use the local copy of vows that is installed via the devDependencies property in the package.json.

from api-easy.

marksweiss avatar marksweiss commented on July 19, 2024

This doesn't work for me. I want to run my unit tests from my project directory calling the vows command line. The above steps run the api-easy unit tests from the api-easy directory. Am I misunderstanding your direction here? Thanks.

from api-easy.

indexzero avatar indexzero commented on July 19, 2024

@markweiss I think I misunderstood you, I thought you were trying to run the unit tests for api-easy itself, not using api-easy in your own project.

@isaacs is there anyway to force a dependency to be installed globally? If not, I'm afraid there is nothing I can do except update the README to install vows globally in addition to installing api-easy.

from api-easy.

marksweiss avatar marksweiss commented on July 19, 2024

@indexzero. Right ... as usual communication is the hardest part of coding. Thanks for the fast follow up.

from api-easy.

indexzero avatar indexzero commented on July 19, 2024

@marksweiss I've created a sample gist of how to use api-easy in a sample project with npm test. In conclusion, it is possible to use api-easy without install vows globally if you use npm test and take api-easy as a dependency in your package.json

Check it out: https://gist.github.com/1039425

from api-easy.

isaacs avatar isaacs commented on July 19, 2024

There is no way to force a package to be installed globally, in part because this is almost never necessary. As @indexzero points out, if you run your test script via npm test, then it will be able to access the command-line utilities of packages that are not installed globally. Also, you could put node_modules/.bin in your PATH, in which case you'll see whichever version of the cli utils are installed in that package.

from api-easy.

indexzero avatar indexzero commented on July 19, 2024

Thanks @isaacs. Helpful as always

from api-easy.

marksweiss avatar marksweiss commented on July 19, 2024

Thanks. I prefer the latter. I don't like the 'npm test' approach as much because the command line less clearly says what is being done compared to 'vows ...' With Are there disadvantages to installing a package globally?

from api-easy.

isaacs avatar isaacs commented on July 19, 2024

The disadvantage of installing a package globally is that it's a single namespace where things can collide with one another, and can easily lead to situations where dependencies are unnamed, and thus your package doesn't work properly on anther system. Use with caution :)

from api-easy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.