AmpersandJS/ampersand-state — pull request #61 by francismakes (2014-09-03 07:54:54+00:00)
Title: Refactoring: remove unused variables, update tests, and single quote test strings.

:wave: Hello &yet!

After going through the code, I found some parts of the base that could be refactored.

Issue 1: After adding `unused: true` to the `.jshintrc`, there are defined but unused variables.

```sh
ampersand-state.js
line 78 col 28 'options' is defined but never used.
line 101 col 13 'triggers' is defined but never used.
line 298 col 13 'type' is defined but never used.
line 680 col 9 'prop' is defined but never used.
line 680 col 15 'item' is defined but never used.
line 753 col 9 'toString' is defined but never used.

test/basics.js
line 130 col 51 'value' is defined but never used.
line 130 col 44 'model' is defined but never used.
line 520 col 9 'lastError' is defined but never used.
line 531 col 42 'error' is defined but never used.
line 531 col 35 'model' is defined but never used.

test/full.js
line 244 col 9 'one' is defined but never used.
line 601 col 44 'newVal' is defined but never used.
line 601 col 36 'oldVal' is defined but never used.
line 800 col 9 'thing' is defined but never used.
line 1133 col 9 'sub2' is defined but never used.
line 1261 col 9 'emptyattrs' is defined but never used.
line 1262 col 9 'undefinedattrs' is defined but never used.
line 1257 col 39 'opts' is defined but never used.
line 1332 col 9 'model' is defined but never used.
```

Issue 2: Because I have set `unused: true`, the tests pass but `jshint` complains because there are variables which are defined but are not used. Within the test, the respective values assigned to the variables are the ones being examined under `testling`.

Issue 3: The test for Issue #1791 is [missing an assertion](https://github.com/francismakes/ampersand-state/compare/AmpersandJS:master...francismakes:master#diff-d52eeda9ba89df3f626cf88a2d2a1879L1330).

Issue 4: Some tests are missing a `t.plan(#)`.

Issue 5: Some test titles are wrapped in double quotes instead of single quotes (not that it really matters...)

This PR:
1. Includes an updated `.jshintrc` with `unused` set to true;
2. Use instances directly without variable assignments (see [here](https://github.com/francismakes/ampersand-state/compare/AmpersandJS:master...francismakes:master#diff-d52eeda9ba89df3f626cf88a2d2a1879R836) and [here](https://github.com/francismakes/ampersand-state/compare/AmpersandJS:master...francismakes:master#diff-d52eeda9ba89df3f626cf88a2d2a1879R1304));
3. Includes `t.plan(#)` where missing; and
4. Updates any and all test names wrapped in double quotes to single quotes.

I didn't see a contributing guide, but am inclined to make the needed revisions where necessary. Thanks!