Skip to content

Commit c114b4b

Browse files
author
Mouse Braun
committed
if travis works this gets sold as 0.4.13 to npm
1 parent 0d9874f commit c114b4b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ addons:
1414
install:
1515
- export DISPLAY=':99.0'
1616
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
17-
- npm install
17+
- npm install
18+
notifications:
19+
slack: microbejs:HKzPLegwioqGdZrzZflUw0Tm

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Change log
138138
#### 0.4.13
139139

140140
+ added travi-ci testing
141+
+ added nightmare command line testing
141142

142143

143144
#### 0.4.12

tests/nightmare.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ var connect = require( 'connect' );
55
var serveStatic = require( 'serve-static' );
66

77
var server = connect().use( serveStatic( process.cwd() ) ).listen( 8666 );
8-
9-
var errors;
8+
var tests;
109

1110
vo( run )( function( err, result )
1211
{
12+
console.log( 'pass: ' + tests.pass + ', fail: ' + tests.fail );
1313
if ( err )
1414
{
1515
throw err;
1616
}
17-
else if ( errors !== 0 )
17+
else if ( tests.fail !== 0 )
1818
{
19-
throw new Error( '\nthere were more than 0 errors (' + errors + ' to be exact)\n' );
19+
throw new Error( '\nthere were more than 0 errors (' + tests.fail + ' to be exact)\n' );
2020
}
2121
else
2222
{
@@ -29,14 +29,16 @@ function *run()
2929
{
3030
var nightmare = Nightmare();
3131

32-
errors = yield nightmare
32+
tests = yield nightmare
3333
.on( 'page-error', function( e ){ console.log( e ); } )
3434
.on( 'page-log', function( e ){ console.log( e ); } )
3535
.goto( 'http://localhost:8666/tests/' )
3636
.wait( '.pass' )
3737
.evaluate( function()
3838
{
39-
return document.getElementsByClassName( 'fail' ).length;
39+
var pass = document.getElementsByClassName( 'pass' ).length;
40+
var fail = document.getElementsByClassName( 'fail' ).length;
41+
return { pass : pass, fail : fail };
4042
} );
4143

4244
server.close();

0 commit comments

Comments
 (0)