-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
startup test including browser_primus update
- Loading branch information
Showing
1 changed file
with
45 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,45 @@ | ||
var path = require('path'); | ||
var filename = path.basename(__filename); | ||
var happn = require('../lib/index'); | ||
var service = happn.service; | ||
|
||
describe(filename, function() { | ||
|
||
require('benchmarket').start(); | ||
after(require('benchmarket').store()); | ||
|
||
beforeEach(function() { | ||
delete process.env.UPDATE_BROWSER_PRIMUS; | ||
}); | ||
|
||
afterEach(function(done) { | ||
if (!this.server) return done(); | ||
this.server.stop(done); | ||
}); | ||
|
||
it('update browser_primus script', function(done) { | ||
// Primus requires dynamic creation of the clientside script, | ||
// We are putting this dynamically created script into lib/public, | ||
// so that there is no need to RE-create the client script with each happn startup | ||
// | ||
// This test does that update so that when primus in upgraded in package.json | ||
// the corresponding new browser_primus is also kept up-to-date. | ||
process.env.UPDATE_BROWSER_PRIMUS = '1'; | ||
var _this = this; | ||
service.create().then(function(server) { | ||
_this.server = server; | ||
done(); | ||
}).catch(done); | ||
}); | ||
|
||
it('default startup time', function(done) { | ||
var _this = this; | ||
service.create().then(function(server) { | ||
_this.server = server; | ||
done(); | ||
}).catch(done); | ||
}); | ||
|
||
require('benchmarket').stop(); | ||
|
||
}); |