Permalink
Browse files

Up the npm version to 0.1.3. Add some more config options.

  • Loading branch information...
1 parent 4a41b7b commit 776c2a0c13a47fd32fcf13f97cb903c6076ec15a Justin Martin committed Jan 21, 2014
Showing with 6 additions and 4 deletions.
  1. +5 −3 immaletyou.browser.js
  2. +1 −1 package.json
@@ -6,11 +6,13 @@
**/
var obj = (function() {
- var mocks, modules = {};
+ var mocks, modules = {}, testsBasePathRegex = '', testsExtensionReplaceRegex = '\.js\?.*';
ImmaLetYou = function(opts) {
this.basePath = opts.basePath || '';
this.defaultMock = opts.defaultMock || {};
+ testsBasePathRegex = opts.testsBasePathRegex || testsBasePathRegex;
+ testsExtensionReplaceRegex = opts.testsExtensionReplaceRegex || testsExtensionReplaceRegex;
};
ImmaLetYou.prototype.finish = function(path) {
@@ -50,8 +52,8 @@ var obj = (function() {
var scripts = document.getElementsByTagName('script');
var last = scripts[scripts.length - 1];
var fullPath = last.src;
- var requirePath = fullPath.replace(/http:\/\/.*\/base\//g,'');
- requirePath = requirePath.replace(/\.js\?.*/g,'');
+ var requirePath = fullPath.replace(new RegExp('http:\/\/.*\/' + testsBasePathRegex,'g'),'');
+ requirePath = requirePath.replace(new RegExp(testsExtensionReplaceRegex, 'g'),'');
modules[requirePath] = callback;
};
return {
View
@@ -1,6 +1,6 @@
{
"name": "immaletyou",
- "version": "0.1.2",
+ "version": "0.1.3",
"description": "Javascript mocking library for use with AMD. Immaletyou also enables you to test your browser AMD modules in node.",
"main": "immaletyou.js",
"scripts": {

0 comments on commit 776c2a0

Please sign in to comment.