Write first class, make tests and took a coffee to understand freaking cordova-plugin ecosystem

This commit is contained in:
Michael Bykovski
2017-07-07 12:41:22 +02:00
parent 1cae514078
commit 2198a81f0b
8 changed files with 170 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
exports.defineAutoTests = function() {
describe('Webserver (window.webserver)', function () {
var fns = [
'start'
];
it('should exist', function() {
expect(webserver).toBeDefined();
});
fns.forEach(function(fn) {
it('should contain a ' + fn + ' function', function () {
expect(typeof webserver[fn]).toBeDefined();
expect(typeof webserver[fn] === 'function').toBe(true);
});
})
});
};
exports.defineManualTests = function(contentEl, createActionButton) {
createActionButton('Start', function() {
webserver.start(
function() {
console.log('Success!');
},
function() {
console.log('Error!');
},
);
});
};