adding jasmine tests
This commit is contained in:
parent
32edfd4e80
commit
1ae28723eb
19 changed files with 4310 additions and 14 deletions
25
lib/tests/server.js
Executable file
25
lib/tests/server.js
Executable file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Simple connect server for phantom.js
|
||||
* Adapted from Twitter Bootstrap
|
||||
*/
|
||||
|
||||
var connect = require('connect'),
|
||||
http = require('http'),
|
||||
fs = require('fs'),
|
||||
app = connect(),
|
||||
pid_path = __dirname + '/pid.txt';
|
||||
|
||||
// clean up after failed test runs
|
||||
if (fs.existsSync(pid_path)) {
|
||||
try {
|
||||
var pid = fs.readFileSync(pid_path, { encoding: 'utf-8' });
|
||||
process.kill(pid, 'SIGHUP');
|
||||
} catch (e) {}
|
||||
fs.unlinkSync(pid_path);
|
||||
}
|
||||
|
||||
app.use(connect.static(__dirname + '/../../'));
|
||||
|
||||
http.createServer(app).listen(3000);
|
||||
|
||||
fs.writeFileSync(pid_path, process.pid, 'utf-8');
|
Loading…
Add table
Add a link
Reference in a new issue