Skip to content

Commit

Permalink
Various minor tweaks (#29)
Browse files Browse the repository at this point in the history
* Fix formatting typo in README

* Make it easier to run and debug the test suite

We _ought_ to add node-inspector to the devDependencies to enable the test:debug script, but that would currently break `npm install` for folks on node v7 because of  node-inspector/node-inspector#950.  For now, contributors will have to install node v6 or lower and manually `npm install node-inspector`.
  • Loading branch information
nchilada authored and tscanlin committed Feb 10, 2017
1 parent 2f7baf1 commit dbae2d3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ tocbot.refresh();

- [Tocbot Homepage](http://tscanlin.github.io/tocbot/)
- [Optimizely's Developer Documentation](https://developers.optimizely.com/x/solutions/javascript/reference/index.html)

If you'd like to add your page to this list open a pull request.


Expand Down Expand Up @@ -288,10 +289,34 @@ If you want to open a pull request just fork the repo but please make sure all t

### Running Tests

#### All tests
```bash
npm run test
```

#### Specific tests
To filter tests by `describe` or `it` description:
```bash
npm test
TEST_NAME="some string that appears in the test description" npm run test
```

#### With debugger
You can run tests through [node-inspector](https://github.com/node-inspector/node-inspector).

[For now, you may need to use node v6 or lower](https://github.com/node-inspector/node-inspector/issues/950#issuecomment-264289415)...
```bash
nvm use 6
```

Once you're on node v6 or lower:
```bash
npm install node-inspector
```

Now that node-inspector is installed, you can run the tests!
```
TEST_NAME="whatever, this is optional" npm run test:debug
```

## Steps to publish

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"serve": "webpack-dev-server --content-base build/ --port 4001",
"start": "npm run clean && npm run mkdirs && npm run build-css && npm run build-docs && npm run dev",
"deploy": "npm run build && gh-pages -d build",
"test": "mocha test/index.js",
"test": "mocha --grep \"$TEST_NAME\" test/index.js",
"test:debug": "node-debug _mocha --timeout 0 --grep \"$TEST_NAME\" test/index.js",
"test:watch": "mocha --watch test/index.js"
},
"repository": {
Expand Down

0 comments on commit dbae2d3

Please sign in to comment.