-
Notifications
You must be signed in to change notification settings - Fork 0
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 87aba75
Showing
17 changed files
with
5,306 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,35 @@ | ||
Tutti Code Examples | ||
=================== | ||
These are the code examples I used in the Tutti demo at JSConf 2011 in Portland. To run these examples, first make sure you have the prerequisite software installed: | ||
|
||
1. [node.js](http://nodejs.org/) | ||
2. [npm](http://npmjs.org/) | ||
3. tutti npm package (installed via `npm install tutti`, `sudo` may be required depending on your installation of npm) | ||
|
||
Next, go to <http://tuttijs.com> and create a room. Copy the URL when you've entered the room, and paste it into the places in the scripts where it says 'PASTE ROOM URL HERE'. | ||
|
||
There are three examples: `testing`, `autotest`, and `feature_detection`. Here's how to run the scripts for each example: | ||
|
||
### Testing | ||
|
||
cd testing | ||
# edit runTests.js to substitute room URL | ||
node runTests.js | ||
|
||
### Autotest | ||
|
||
cd autotest | ||
# edit runTests.js to substitute room URL | ||
node runTests.js | ||
# now you need to actually edit the map.js and testMap.js files and save | ||
# them to trigger a re-run of the tests. | ||
|
||
### Feature Detection(generate a browser feature comparison table) | ||
|
||
cd feature_detection | ||
# edit features.js to substitute room URL | ||
./features.sh | ||
open features.html | ||
|
||
I hope these instructions are sufficient to get it going for you. If not, ping me on twitter: @airportyh. | ||
|
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,47 @@ | ||
(function(){ | ||
|
||
function red(s){ return ["\033[31m", s, "\033[0m"].join('') } | ||
function green(s){ return ["\033[32m", s, "\033[0m"].join('') } | ||
function cyan(s){ return ["\033[36m", s, "\033[0m"].join('') } | ||
function yellow(s){ return ["\033[33m", s, "\033[0m"].join('') } | ||
function blue(s){ return ["\033[34m", s, "\033[0m"].join('') } | ||
|
||
function ConsoleJasmineReporter(){ | ||
} | ||
|
||
ConsoleJasmineReporter.prototype.reportRunnerResults = function(runner){ | ||
var output = [], | ||
results = runner.results(), | ||
specs = runner.specs() | ||
var msg = [specs.length, 'specs,', results.failedCount, 'failures.'].join(' ') | ||
if (results.failedCount > 0) | ||
msg = red(msg) | ||
else | ||
msg = green(msg) | ||
output.push(msg) | ||
|
||
|
||
for (var i = 0; i < specs.length; i++) { | ||
var spec = specs[i] | ||
var results = spec.results() | ||
if (results.failedCount > 0){ | ||
var items = results.getItems() | ||
var numItems = items.length | ||
for (var j = 0; j < numItems; j++){ | ||
var result = items[j] | ||
if (result.type == 'log') | ||
output.push(' LOG: ' + result.toString()) | ||
else if (result.type == 'expect' && | ||
result.passed && !result.passed()){ | ||
output.push(spec.getFullName()) | ||
output.push(' ' + red(result.message)) | ||
} | ||
} | ||
} | ||
} | ||
console.log(output.join('\n')) | ||
} | ||
|
||
window.ConsoleJasmineReporter = ConsoleJasmineReporter | ||
|
||
}()) |
Oops, something went wrong.