• Robert Knight's avatar
    Fix warning about loading Angular twice in tests · a18bdaf6
    Robert Knight authored
    The Angular.js bundle was evaluated a second time because a module that
    required angular was proxyquire-d in session-test.js. When
    `proxyquire(...)` loads a module, it does so with a fresh, empty module
    cache [1] which is removed once the `proxyquire(...)` call returns.
    
    As a result, every module that is transitively required by the
    proxyquire'd module will be re-evaluated during the `proxyquire(...)`
    call.
    
    Aside from the performance cost for large modules, this is also bad for
    any module which has side-effects as part of its evaluation. Angular
    happens to detect this and abort when evaluated a second time.
    
    The fix here is to use Angular's DI system to mock the only stubbed
    dependencies instead of proxyquire.
    
    [1] The _module cache_ is a (module ID/name => exports object) map.
    a18bdaf6
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
yarn.lock Loading commit data...