Permalink
Browse files

First commit. Far from done.

  • Loading branch information...
jrburke committed May 16, 2011
0 parents commit bd7c2bdf9434fb0e36eb0facc76e4b60e66bae4d
@@ -0,0 +1,43 @@
+# AMD Tests
+
+This is the start of Asynchronous Module Definition
+[AMD](http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition) compliance
+tests.
+
+Right now the tests only run in the browser, but it will be possible to run
+them in Node and Rhino.
+
+# Configuration
+
+An implementation needs to have the following two files:
+
+* AMD loader implementation
+* configure script
+
+The configure script should define the following variables:
+
+* **config**: a function that accepts configuration parameters. Similar to the
+RequireJS form of require({}).
+
+* **go**: a function that implements the top level, global function that starts
+loading of modules. Equivalent to the RequireJS global require([], function(){})
+signature.
+
+* implemented: an object whose properties are the types of tests that the
+loader expects to pass.
+
+The full list of test types:
+
+* **basic**: Very basic loading of named modules that have dependency arrays.
+
+TODO: Add more.
+
+# Running the tests
+
+Run the tests through a web server. The URL should look like the following:
+
+ http://127.0.0.1/amd-tests/tests/doh/runner.html?testUrl=../bootstrap&config=path/to/confi.js&impl=path/to/loader.js
+
+To run the tests using the version of RequireJS in this repository:
+
+ http://127.0.0.1/amd-tests/tests/doh/runner.html?testUrl=../bootstrap&config=../../impl/requirejs/config.js&impl=../../impl/requirejs/require.js
@@ -0,0 +1,12 @@
+
+//Map the configure({}) call to loader-specific call.
+var config = require,
+
+ //Map the top-level entry point to start loading to loader-specific call.
+ go = require,
+
+ //Indicate what levels of the API are implemented by this loader,
+ //and therefore which tests to run.
+ implemented = {
+ basic: true
+ };
Oops, something went wrong.

0 comments on commit bd7c2bd

Please sign in to comment.