computmaxer / karma-jspm

Other
74 stars 50 forks source link

CP-1061 Import modules in the order they were specified in config #102

Closed ahelmberger closed 8 years ago

ahelmberger commented 8 years ago

We would like to make the order, in which modules are loaded, deterministic. They should be imported in the order specified in karma.conf.js. E.g. given this configuration:

jspm: {
  serveFiles: ['**/*'],
  loadFiles: ['polyfills.js', '**/*.specs.js']
}

The current implementation would attempt to load all modules simultaneously. This can lead to different behavior between test runs, especially in the above case, where the first module adds some global polyfills other modules rely on.

With this changeset, all files specified in the loadFiles array will be imported sequentially.

From a perfomance perspective: we could not notice any difference between simultaneous/sequential import, tested in a project with about 400 tests and about 170 modules.

trentgrover-wf commented 8 years ago

@maxwellpeterson-wf @evanweible-wf

evanweible-wf commented 8 years ago

+1 once Trent's comment has been addressed

rmconsole2-wf commented 8 years ago

@ahelmberger This pull request has merge conflicts, please resolve.

ahelmberger commented 8 years ago

Thanks for the feedback, I rebased on the current master and used the IE8-compatible syntax.

alexcastillo commented 8 years ago

+1

trentgrover-wf commented 8 years ago

+1 @maxwellpeterson-wf @jayudey-wf

maxwellpeterson-wf commented 8 years ago

+1

jayudey-wf commented 8 years ago

QA Resource Approval: +10

Merging into master.