How to load third party libraries in karma.conf.js - karma-jasmine

I am using OneDrive library file to launch OneDrive picker in my angular project. It works correctly in my application. But when i tried to test with Karma, i am getting error 'Cannot find variable OneDrive'.
So I have included reference karma.conf.js
files: [
'http://js.live.net/v7.0/OneDrive.js'
],
After including library file getting error 'Error: [OneDriveSDK Error] object was missing and not optional in http://js.live.net/v7.0/OneDrive.js (line 2)'. Is there any way to resolve this issue?

Related

Errors when trying to integrate PruneCluster into Webpack

I am trying to integrate PruneCluster for Leaflet into my Webpack configuration, and I’m doing exactly what’s in the Readme https://github.com/SINTEF-9012/PruneCluster#webpack--npm
But I keep getting this error
Module build failed (from ./node_modules/exports-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
at Object.loader (/Users/username/Documents/Repository/project-name/web/app/themes/project-name/node_modules/exports-loader/dist/index.js:23:24)
Are there any dependencies I am missing or do I need some form of config file?

getting "path error" when adding external libraries to Skulpt

I am trying to use Python's matplotlib with Skulpt in App Inventor/Thunkable, I created a "third-party.js" file following this link https://gist.github.com/bnmnetp/20bd9105f11f2a164fc0
and I added the file in App Inventor.
I am getting this error
:NetworkError: Failed to execute 'send' on 'XMLHttpRequest':Failed to
load
'file:///static/primeronoo/skulpt/external/matplotlib/init.js'.
What should I do ?

Libraries installed but didn't work in react-native environment

Anytime I install Library, whether it is, native base or react-native text-input effects.it gives the same error every time..
I don't know what's causing an issue here.
error: bundling failed: Error: While trying to resolve module
native-base` from file `/home/jas/Hopper/screen/Home.js`, the package `
/home/jas/Hopper /node_modules/native-base/package.json` was successfully
found. However, this package itself specifies a `main` module field that
could not be resolved (`/home/jas/Hopper/node_modules/native-base/dist
/src/index.js`. Indeed, none of these files exist:
Delete the build folder in /node_modules/native-base/android/app

Appcelerator Titanium module TiJSPDF

I would like to use this module on my Titanium project : https://github.com/AppWerft/TiJSPDF
To install, I have just copied the folder 'modules' in my project and I have added it in tiapp.xml.
When I try to use it :
require('ti.jspdf');
var doc = new jsPDF();
I get the following error :
- Message: Uncaught ReferenceError: jsPDF is not defined
I think I don't use this module correctly. Can you help me, please ?
Since this is a javascript module and not a compiled module, put it in the app/lib folder of your alloy project. See the documentation on Javascript modules here: http://docs.appcelerator.com/platform/latest/#!/guide/CommonJS_Modules_in_Titanium-section-src-29004791_CommonJSModulesinTitanium-JavaScriptModules

Sencha EXT JS making Ext.ux.panel.PDF to work

I have planned to use the Ext.ux.panel.PDF extension https://github.com/SunboX/ext_ux_pdf_panel for my app but cannot make it to work inside my Sencha Architect 3.0.
I have downloaded the files and put the js file in my project directory /ext/src/ux/panel/PDF.js. In the apllication I have put the require line on the top level under Application
Ext.application({
requires: [
'Ext.window.MessageBox',
'Ext.ux.panel.PDF'
], ...
But when I want to instantiate the pdf panel with the code from the example I keep getting this error:
Uncaught Error: The following classes are not declared even if their files have been loaded: 'Ext.ux.panel.PDF'. Please check the source code of their corresponding files for possible typos: 'ext/src/ux/panel/PDF.js
Please advise.
EDIT: I have tried using a loader but the error is still present
Ext.Loader.setConfig({
enabled: true,
paths: {
Ext: 'ext/src'
}
});
The error you get means, that the file ext/src/ux/panel/PDF.js does not contain valid javascript. I tested this extension, and I don't get that error.
It the file is empty, you will get this error only, if it contains invalid javascript, this should be the second error, while the first will complain about the syntax error.
If the file is missing, you'll get another error.
Have a close look at the file, maybe it got corrupted while downloading or unzipping the extension. Or you edited it by error and introduced an error.
try to add below code on top of your Ext.application({ ~~~ source
Ext.Loader.setPath({
'Ext.ux' : 'YOURPATH(ABSOLUTE OR RELATIVE)/ext/src/ux'
});