mirror of
https://github.com/bykof/cordova-plugin-webserver.git
synced 2026-04-20 00:02:45 +08:00
Write first class, make tests and took a coffee to understand freaking cordova-plugin ecosystem
This commit is contained in:
@@ -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!');
|
||||
},
|
||||
|
||||
);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user