Comments (2)
Hi @matthewcornell!
What
The qunit
command is reported as not found because you tried to execute it as a "global" command, but QUnit is usually best to install "locally" in a project, not globally.
Why
In the Bash shell, when you run a command, the first "word" refers to the name or path of a program. When you refer to a program by its name only (such as grep
, node
, or npm
; instead of /usr/bin/grep
or ./bin/qunit
) then Bash will try to find a program by that name in the system-wide /usr/bin
and /usr/local/bin
directories (decided by thePATH
environment variable).
I generally recommend that developers install tools like bash, Node.js and npm globally, and indeed that is what you have done. The choice to use QUnit (and which version) is specific to each software project, and you may be trying out multiple projects by multiple people. You might have a project in ~/Documents/foo/
that uses QUnit 1.x, and a project in ~/Documents/bar/
that uses QUnt 2.x. This is possible because each has their own package.json
file that tells npm which version to install in the local node_modules
directory.
How
When you run npm test
, the npm tool creates a Bash context where the local node_modules/.bin/
directory is temporarily included to your Bash PATH, so that it can execute the qunit
command. If you've used other packages via npm, these will work the same way. I recommend using npm test
and package.json
so that you avoid accidentally making your project dependent on a program that you have installed on your computer globally, without declaring it in your local package.json
file. That way, when you share your program with someone else, or when you work on it from another computer, it still works the exact same way.
Answer
You can experiment with variations of commands, without needing to edit package.json, by using the npx
command. This basically says "pretend to be inside a package.json 'script' context". For example: npx qunit -w
will run ./node_modules/.bin/qunit -w
.
from qunit.
What an amazingly friendly, detailed, and clear message. Much appreciated 👍 !
from qunit.
Related Issues (20)
- [2.19.2] Regression with `deepEqual` on hashes HOT 7
- feat: disable html reporter entirely for headless CI HOT 4
- Great convergence effort/suggestion: Making QUnit proxy to node.js and deno testing APIs in these environments HOT 2
- Add DOM hook to allow links to be added after the Rerun link
- Allow non-escaped HTML to be used as an assertion message HOT 1
- importing .css file using webpack css-loader/style-loader causes: TypeError: Unknown file extension ".css" HOT 2
- Improve assert.async Function to Handle Type Checking
- Qunit v2 has incorrectly configured exports HOT 4
- Drop support for IE9-IE10 HOT 3
- Can we move this repo to a monorepo so we can more accurately test different usage scenarios? HOT 1
- Drop support for node < 18? HOT 1
- Can we drop builtin AMD support? HOT 6
- Can we start a `next` branch so I can start PRing improvements? HOT 1
- Let simple array data in test.each() serve as automatic labels
- Facilitate "close to" number equal assertion HOT 3
- [Feature Request]: Allow more customization of how errors are handled (especially uncaughtrejection). HOT 1
- Web Test Runner and QUnit reporting problems HOT 9
- qunit cannot parse private functions and properties HOT 2
- Support multiple `module` parameters (QUnit.config.module array) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qunit.