Closed ninjasort closed 9 years ago
Intern tests must be written as AMD modules. However, they can use and test CommonJS modules, and can be written using a minimal form of the AMD wrapper that is very similar to CommonJS syntax. Check out the code examples in the new Intern guide.
Or see the example and discussion at https://github.com/theintern/intern-tutorial/issues/15#issuecomment-70301481 ... basically you can use an AMD module to load tests written as CJS modules.
@dylans thanks - you caught me just in time. i was about to type all that again :smile:
Interesting, hadn't seen that.
Immortalized in a gist: https://gist.github.com/jason0x43/3e3c00265c3fc573b48d
thanks
Intern tests must be written as AMD modules.
I was sold on Intern until I got to this one factor. Why-o-why??
basically you can use an AMD module to load tests written as CJS modules.
But then you would need to learn and actively use both module systems just to write tests(?) Why force this upon users who will have their own preferences? @ericelliott has it bang on in his comments and I only see the sway growing towards CommonJS inspired module systems with ES6 Harmony setting the future direction and being very much on the near horizon. Forcing AMD style makes it a hard sell.
Very disappointing.
@ijy “Why-o-why” is described in the user guide under Conventions. Please take a look.
Also look at any of the links that @jason0x43 posted above.
is it possible to do a tutorial without AMD using just CommonJS?