Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main #23

Open
wants to merge 7 commits into
base: updateEslint
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
# How to debug Jester

You attach a graphical debugger ([node-inspector]) to jester.
You attach a graphical debugger ([Node Inspector]) to jester.

- Install [node-inspector] somewhere. Doesn't matter where.
- Install [Node Inspector] somewhere. Doesn't matter where.

$ npm install node-inspector

- Start node-inspector.

$ node_modules/.bin/node-inspector
Node Inspector v0.7.4
Visit http://127.0.0.1:8080/debug?port=5858 to start debugging.

*node-inspector* now waits for the process-to-debug on port 5858, and for you on port 8080.

- Start jester in debug mode.

$ node --debug-brk node_modules/jester-tester/src/bin/jester-watch.js
$ node-debug node_modules/jester-tester/src/bin/jester-watch.js
debugger listening on port 5858

- Browse to http://127.0.0.1:8080/debug?port=5858.
- Node Inspector opens http://127.0.0.1:8080/debug?ws=127.0.0.1:8080&port=5858 in a browser.
- Place your breakpoints and press the play button to start running jester.

[node-inspector]: https://npmjs.org/package/node-inspector
[Node Inspector]: https://npmjs.org/package/node-inspector
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
**NOTE: you probably want the @next version of jester tester!**

You can install it using `npm install jester-tester@next`. I've been working on it for a while now and it has a bunch of needed improvements such as being able to configure webpack and eslint directly. However I'm currently beta testing it and I have yet to add a migration script. Eslint is doing a lot of breaking changes at the moment while they're ramping up for their 1.0 release so I won't make the @next version the default until after the 1.0 eslint release. I also might replace karma with testem before that.

But me and my team are using the @next version full time, so it probably won't delete your entire file system. I encourage new jester users to start with the @next version. Just be aware that you might have a non-automatic upgrades (usually changing some settings, renaming some properties) for new releases.

If you encounter anything: let me know at https://github.com/jauco/jester/issues !


#Jester

>Get your project tested and out there with minimal fuss.
Expand All @@ -15,7 +24,7 @@ The goal of Jester is to give you a bootstrap for integrating these tools so you
1. Install [node.js](http://nodejs.org/download/)
2. Create a directory for your app `mkdir myApp; cd myApp`
3. Add a basic machine readable description of your app `npm init`
4. Install jester from npm and save it into the development dependencies. Under windows you'll have to run this as administrator (required by jsdoc for creating symlinks):
4. Install jester from npm and save it into the development dependencies. Under windows you'll have to run this as administrator (required by jsdoc for creating symlinks):
`npm install --save-dev jester-tester`

## Creating a project
Expand Down Expand Up @@ -127,7 +136,7 @@ describe("Greetings", function() {
```

This test asserts that the function hello will return the string `hello tested world`.
The test will run upon saving it if jester-watch is running, or else when you
The test will run upon saving it if jester-watch is running, or else when you
execute jester-batch.

Jester will now run your tests in the browsers as specified in `jester.js`. Of
Expand All @@ -144,7 +153,7 @@ module.exports = hello;

##Dependency injection
Jester makes it easy to replace a 'require'd module in the source file with a
test-stub.
test-stub.

Let's say we have a file called src/lib/db.js
```javascript
Expand Down Expand Up @@ -196,15 +205,15 @@ what happens under the hood. It's not really magical.

## Generating documentation from source

Documentation will be generated from appropriately annotated sources by jsdoc and includes the syntax highlighted source code. See [usejsdoc](http://usejsdoc.org/) for how to annotate your code, especially relevant is [Document CommonJS Modules](http://usejsdoc.org/howto-commonjs-modules.html).
Documentation will be generated from appropriately annotated sources by jsdoc and includes the syntax highlighted source code. See [usejsdoc](http://usejsdoc.org/) for how to annotate your code, especially relevant is [Document CommonJS Modules](http://usejsdoc.org/howto-commonjs-modules.html).

There are many ways to export and document code. The recommended way to export functions is:

/**
* Deep clone an object
*
* @param {Object} obj - the object to clone
* @returns {Object} a deep clone of the original object
* @returns {Object} a deep clone of the original object
* @see {@link http://stackoverflow.com/questions/728360/most-elegant-way-to-clone-a-javascript-object}
*/
function clone(obj) {
Expand All @@ -215,8 +224,8 @@ There are many ways to export and document code. The recommended way to export f

This enables jsdoc to recognize that clone is a (static) function, the clone symbol will show up in stack traces and is fully supported by IE8.

The api documentation will be written to a directory specified by the `apiDocPath` setting in `jester.json`, which defaults to `./doc/api/`. You can set the configuration option `readme` to point to a file that is a markdown formatted readme which will be included in the generated documentation on the homepage.
The api documentation will be written to a directory specified by the `apiDocPath` setting in `jester.json`, which defaults to `./doc/api/`. You can set the configuration option `readme` to point to a file that is a markdown formatted readme which will be included in the generated documentation on the homepage.

The api documentation will be generated when you run `jester-batch` or `jester-doc`. The latter is a bit faster because it *only* runs jsdoc. The documentation is *not* automatically updated when running `jester-watch`.
The api documentation will be generated when you run `jester-batch` or `jester-doc`. The latter is a bit faster because it *only* runs jsdoc. The documentation is *not* automatically updated when running `jester-watch`.

An additional benefit of annotating your code with jsdoc style comments is that there are a number of tools such as ide's and compilers which can take advantages of the additional information contained in those comments.
An additional benefit of annotating your code with jsdoc style comments is that there are a number of tools such as ide's and compilers which can take advantages of the additional information contained in those comments.
2 changes: 1 addition & 1 deletion src/lib/handleWebpackResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function handleWebpackResult(stats, webpackWarningFilters) {

var logErrorsByLine = function (errors) {
byLine(errors, function (err) {
console.log(" ", err, typeof err);
console.log(" ", err);
});
};

Expand Down