These are chat archives for systemjs/systemjs

3rd
Sep 2015
λex Vincent
@alexisvincent
Sep 03 2015 07:41
@guybedford
johnman
@johnman
Sep 03 2015 09:56
Hi all, I have been looking at getting testing working with my systemjs code. After some experimentation I've got karma, jasmine and systemjs playing well together (ish coverage report only lists the files I've imported and not all the app files..yet)
my question is how would I swap out an import for a specific file in a test?
johnman
@johnman
Sep 03 2015 10:02
e.g. Webpack example: var thingToTestInjector = require('inject?../../dependencytoswapout!../../filethatusesthatdependency); and then later on: var thingToTest = thingToTestInjector({"../../dependencytoswapout":{myapi:localfunction}});
I was thinking System.set but that would swap it out for all tests unless I get the original first and then set it back after the tests?
johnman
@johnman
Sep 03 2015 11:20
Currently using path in system config, would calling system config and passing a packing that remaps the child dependency work? (Again it would be good to reset this after the test runs)
Sean Anderson
@MeoMix
Sep 03 2015 23:52
Is there a way to load an external dependency not from a CDN? I get CORS errors when I try System.import('https://www.google-analytics.com/analytics.js'); Should I just settle for appending a script tag to the DOM in this scenario?