-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 35d7348
Showing
5 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tmp/ | ||
node_modules/ | ||
film/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
|
||
}); |