Skip to content

Commit

Permalink
First import.
Browse files Browse the repository at this point in the history
  • Loading branch information
topfunky committed Mar 6, 2012
0 parents commit 35d7348
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tmp/
node_modules/
film/
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DESCRIPTION
===========

Running the `--watch` option successfully runs tests, but doesn't reload the implementation code.

To recreate:

npm install
./node_modules/mocha/bin/mocha --reporter spec --watch

Edit `lib/pie.js` to print a message to the console.

You won't ever see that message.

Expected:

The message should be printed to the terminal.

Addendum:

The message is properly printed if you stop `mocha` and run it alone (for example, `npm test`).
9 changes: 9 additions & 0 deletions lib/pie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// IMPLEMENTATION
function Pie(attributes) {
for (var key in attributes) {
this[key] = attributes[key];
}
return this;
}

module.exports = Pie;
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"author": "Geoffrey Grosenbach <boss@topfunky.com> (http://peepcode.com)",
"name": "bug-mocha-watch",
"description": "A demo project to show a bug in running mocha with --watch",
"version": "0.0.1",
"repository": {
"url": ""
},
"scripts": {
"test": "./node_modules/mocha/bin/mocha --reporter spec"
},
"engines": {
"node": "~0.6.10"
},
"dependencies": {
"mocha": "~0.14.0"
},
"devDependencies": {},
"optionalDependencies": {}
}
12 changes: 12 additions & 0 deletions test/pie_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
assert = require('assert');
Pie = require('../lib/pie');

// TEST
describe("Pie", function() {

it("makes new", function() {
var pie = new Pie({name:'Apple'});
assert.equal(pie.name, 'Apple');
});

});

0 comments on commit 35d7348

Please sign in to comment.