{"action":"opened","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/833","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/833/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/833/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/833/events","html_url":"https://github.com/systemjs/systemjs/issues/833","id":110462687,"number":833,"title":"Importing mocked module fails","user":{"login":"peteruithoven","id":523210,"avatar_url":"https://avatars.githubusercontent.com/u/523210?v=3","gravatar_id":"","url":"https://api.github.com/users/peteruithoven","html_url":"https://github.com/peteruithoven","followers_url":"https://api.github.com/users/peteruithoven/followers","following_url":"https://api.github.com/users/peteruithoven/following{/other_user}","gists_url":"https://api.github.com/users/peteruithoven/gists{/gist_id}","starred_url":"https://api.github.com/users/peteruithoven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteruithoven/subscriptions","organizations_url":"https://api.github.com/users/peteruithoven/orgs","repos_url":"https://api.github.com/users/peteruithoven/repos","events_url":"https://api.github.com/users/peteruithoven/events{/privacy}","received_events_url":"https://api.github.com/users/peteruithoven/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-08T14:24:01Z","updated_at":"2015-10-08T14:24:01Z","closed_at":null,"body":"Using examples from https://github.com/systemjs/systemjs/issues/725 I'm trying to register an inline (mock) module and importing it. \r\n\r\n``` javascript\r\n      var normalizedName = System.normalizeSync('custom-module');\r\n      System.set(normalizedName, System.newModule({\r\n        mock: 'export'\r\n      }));\r\n      System.import(normalizedName,function(m) {\r\n      \tconsole.log('imported custom-module: ', m);\r\n      })\r\n```\r\nThis gives the following error. When I add the code directly in a script tag, it shows on which line it fails. \r\n```\r\nUncaught TypeError: n.indexOf is not a function\r\n  e                      @ system.src.js:4208\r\n  (anonymous function)   @ system.src.js:4208\r\n  (anonymous function)   @ system.src.js:4208\r\n  r.import               @ system.src.js:4208\r\n  e                      @ system.src.js:4208\r\n  (anonymous function)   @ (index):13\r\n```\r\nThis error is not thrown when I don't add a callback to the `System.import` call. \r\n\r\nBasically I'm looking for some way to mock dependencies of modules I'm testing with some inline code. For example to test a REST api library by mocking fetch or jQuery's ajax calls. Any and all tips are appreciated. "}}