FAQ Database Discussion Community


Import jQuery Plugin with JSPM

jquery,plugins,shim,jspm
I'm trying to import the jQuery plugin jQuery.scrollTo with JSPM. So far I installed it with jspm install npm:jquery.scrollto and now I'm trying to import it with import $ from 'jquery'; import scrollTo from 'jquery.scrollto'; Now I'm only getting $(...).scrollTo is not a function errors. I tried to shim it,...

How to throw an exception from the method with return type as void using Microsoft Fakes on VS 2013

c#,stub,microsoft-fakes,shim
I have the following code I am unit testing. public static MyConfiguration GetConfig(string sectionName) { if (!Initialized) { try { InitializeEnv(); // Method is present but no implementation yet. } finally { Initialized = true; if (configurationReader == null) { configurationReader = ConfigurationValueReader.ConfigurationReader(); } } } return (MyConfiguration)configurationReader.ReadSection(sectionName, new MyConfigurationHandler());...

How to shim tinymce in webpack?

javascript,node.js,tinymce,webpack,shim
I'm trying to get tinymce recognized by webpack. It sets a property named tinymce on window, so evidently one option is to require() it using syntax like this (described at the bottom of the EXPORTING section of the webpack docs): require("imports?window=>{}!exports?window.XModule!./file.js But in this example, how is ./file.js resolved? I...

Is there a shim for SVG transformOrigin in IE

javascript,internet-explorer,svg,shim
I'm trying to make an animation using SVG but IE doesn't like playing with transformOrigin. It works in Chrome and Firefox. Try it in IE to see what I mean. Oh, and I don't want to depend on flash. I'll do canvas if required. Or even Shumway. Relevant code var...

Drupal 8 jQuery conflict

javascript,jquery,drupal,browserify,shim
On the front end part of my Drupal 8 project, I have several javascript modules linked together using Browserify (and gulp). In several modules I use Foundation, and the way Foundation is made is that it adds a foundation() function to the $ object. This is an excerpt of my...

How I can stub IDBconnection

unit-testing,mstest,stub,microsoft-fakes,shim
I am writting Unit Test for my database connection. I have following class Public class A { public IDbConnection _dbConnection; public A() { _dbConnection = new SqlConnection(connectionStringName); } public int ExecuteNoneQuery(CommandDefination command) { return _dbConnection.Execute(command); } } I want to test this class, how I can test with Microsoft Stub/Shim...