Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Why using AMD instead of CommonJs for testing ? #3

Closed

Description

@JonathanDaSilva

I would like to know if they are a specifique reason to go with requirejs instead of your karma-commonjs preprocessor ?

Best Regards.

Activity

  1. vojtajina commented on Nov 5, 2014

    @vojtajina
    Contributor

    Eventually, once the browsers support ES6 modules, you won't need any module loader. In the meantime, we will be probably using es6-module-loader (which is a polyfil according to the spec). On Angular 2.0 we are already using it. The reasons why I used RequireJS in this playground was that 1/people are more familiar with it 2/ you also need system.js + register extension to consume Traceur's output with es6-module-loader. Once we simplify this, I will probably change this playground to use es6-module-loader instead.

    As you said, I could use CommonJS syntax and karma-commonjs plugin but I would still need some module loader such as mr or browserify to load the code in a browser (without Karma).

    Sorry, I know this is pretty confusing.
    Hope this explains. Feel free to ask more questions.

  2. JonathanDaSilva commented on Nov 5, 2014

    @JonathanDaSilva
    Author

    Thanks for the response. I understand. This question came because for unit testing, if you use requirejs you need a javascript file for setting all this up (test/main.js). With karma-commonjs you can do all out of the box and I think it's less confussing :).

    Anyway thanks.

    Sorry for my poor english.
    Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions