smartbrowser/test/test.js
2016-09-19 20:00:19 +02:00

33 lines
2.5 KiB
JavaScript

"use strict";
require("typings-test");
const should = require("should");
const smartbrowser = require("../dist/index");
let testSmartBrowser;
describe('smartbrowser', () => {
it('should instanstiate a new browser ', function () {
testSmartBrowser = new smartbrowser.Smartbrowser({
webroot: './test/assets/',
watchFiles: ['./test/assets/']
});
should(testSmartBrowser).be.instanceof(smartbrowser.Smartbrowser);
});
it('should start the browser ', function (done) {
testSmartBrowser.start().then((bsInstance) => {
done();
}).catch((err) => { console.log(err); });
});
it('should stop the browser ', function (done) {
this.timeout(10000);
setTimeout(() => {
testSmartBrowser.stop().then(() => {
done();
}).catch((err) => { console.log(err); });
}, 2000);
});
it('should exit correctly', function () {
setTimeout(() => {
process.exit(0);
}, 2000);
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQixpQ0FBZ0M7QUFFaEMsOENBQTZDO0FBRTdDLElBQUksZ0JBQTJDLENBQUE7QUFFL0MsUUFBUSxDQUFDLGNBQWMsRUFBRTtJQUNyQixFQUFFLENBQUMsb0NBQW9DLEVBQUU7UUFDckMsZ0JBQWdCLEdBQUcsSUFBSSxZQUFZLENBQUMsWUFBWSxDQUFDO1lBQzdDLE9BQU8sRUFBRSxnQkFBZ0I7WUFDekIsVUFBVSxFQUFFLENBQUMsZ0JBQWdCLENBQUM7U0FDakMsQ0FBQyxDQUFBO1FBQ0YsTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxZQUFZLENBQUMsWUFBWSxDQUFDLENBQUE7SUFDckUsQ0FBQyxDQUFDLENBQUE7SUFDRixFQUFFLENBQUMsMkJBQTJCLEVBQUUsVUFBVSxJQUFJO1FB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