I am creating a hybrid app using onsenui.
I'd like to do a unit test using Karma and jasmin.
The following error occurs when running the test:
Error: isWebView() method is available after dom contents loaded.
Onsenui is DI with angularJS.
var appModule=angular.module('app', ['onsen']);
If you know how to avoid it, please let me know.
onsen-ui jasmine
Spy ons.isWebView()
to always return true
.
describe('Test OnsenUI', function(){
beforeEach(function(){
spyOn(ons, 'isWebView').and.returnValue(true);
});
it('test sample', function(){
// write a test here
});
});
© 2024 OneMinuteCode. All rights reserved.