Integrate unused CommonJS tests where applicable (#195)

There has been an unused copy of [The Official Specs for CommonJS][1]
lying around in our repository for who knows how long. They needed to be
built using a python script and then manually executed in a browser.
This commit integrates all of those tests that also apply to our module
system into our existing test suite for `require` & `define`.

Adds adapted versions of the following CommonJs tests to our
`test.require.js`:

    absolute, transitive, determinism, method, nested, hasOwnProperty

The hasOwnProperty test actually uncovered a bug in our module system
implementation and thus is deactivated right now.

The following CommonJS tests were not applicable to Cordova's module
system since it does not support cyclic dependencies at all:

    cyclic, monkeys

The following CommonJS tests were already covered by tests in
`test.require.js`:

- missing: covered by Test#005
- relative: covered by Test#012
- exactExports: covered by multiple tests

[1]: https://github.com/commonjs/commonjs
diff --git a/.eslintignore b/.eslintignore
index f76b665..6fe33ed 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,2 +1 @@
 pkg/**
-tasks/vendor
diff --git a/.ratignore b/.ratignore
index d7f3a49..9e4c1e1 100644
--- a/.ratignore
+++ b/.ratignore
@@ -1,3 +1 @@
-tasks/vendor
-vendor
 appveyor.yml
diff --git a/tasks/vendor/commonjs-tests/README.txt b/tasks/vendor/commonjs-tests/README.txt
deleted file mode 100644
index 21ce798..0000000
--- a/tasks/vendor/commonjs-tests/README.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-The test cases contained in this directory were obtained from the
-commonjs project at GitHub:
-
-   https://github.com/commonjs/commonjs
-
-Specifically, the directories in the 'tests' subdirectory.
-
-See the file test/commonjs/README.txt off the root directory of this
-project for more information.
\ No newline at end of file
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/absolute/b.js b/tasks/vendor/commonjs-tests/modules/1.0/absolute/b.js
deleted file mode 100644
index da5bf4f..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/absolute/b.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.foo = function() {};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/absolute/program.js b/tasks/vendor/commonjs-tests/modules/1.0/absolute/program.js
deleted file mode 100644
index 7980ecf..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/absolute/program.js
+++ /dev/null
@@ -1,5 +0,0 @@
-var test = require('test');
-var a = require('submodule/a');
-var b = require('b');
-test.assert(a.foo().foo === b.foo, 'require works with absolute identifiers');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/absolute/submodule/a.js b/tasks/vendor/commonjs-tests/modules/1.0/absolute/submodule/a.js
deleted file mode 100644
index bc138b8..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/absolute/submodule/a.js
+++ /dev/null
@@ -1,3 +0,0 @@
-exports.foo = function () {
-    return require('b');
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/absolute/test.js b/tasks/vendor/commonjs-tests/modules/1.0/absolute/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/absolute/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/a.js b/tasks/vendor/commonjs-tests/modules/1.0/cyclic/a.js
deleted file mode 100644
index e0188fa..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/a.js
+++ /dev/null
@@ -1,4 +0,0 @@
-exports.a = function () {
-    return b;
-};
-var b = require('b');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/b.js b/tasks/vendor/commonjs-tests/modules/1.0/cyclic/b.js
deleted file mode 100644
index 873a305..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/b.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var a = require('a');
-exports.b = function () {
-    return a;
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/program.js b/tasks/vendor/commonjs-tests/modules/1.0/cyclic/program.js
deleted file mode 100644
index 2ee4758..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/program.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var test = require('test');
-var a = require('a');
-var b = require('b');
-
-test.assert(a.a, 'a exists');
-test.assert(b.b, 'b exists')
-test.assert(a.a().b === b.b, 'a gets b');
-test.assert(b.b().a === a.a, 'b gets a');
-
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/test.js b/tasks/vendor/commonjs-tests/modules/1.0/cyclic/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/cyclic/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/determinism/program.js b/tasks/vendor/commonjs-tests/modules/1.0/determinism/program.js
deleted file mode 100644
index 7c0e50b..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/determinism/program.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var test = require('test');
-require('submodule/a');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/determinism/submodule/a.js b/tasks/vendor/commonjs-tests/modules/1.0/determinism/submodule/a.js
deleted file mode 100644
index 215ea1d..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/determinism/submodule/a.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var test = require('test');
-var pass = false;
-var test = require('test');
-try {
-    require('a');
-} catch (exception) {
-    pass = true;
-}
-test.assert(pass, 'require does not fall back to relative modules when absolutes are not available.')
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/determinism/submodule/b.js b/tasks/vendor/commonjs-tests/modules/1.0/determinism/submodule/b.js
deleted file mode 100644
index 139597f..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/determinism/submodule/b.js
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/determinism/test.js b/tasks/vendor/commonjs-tests/modules/1.0/determinism/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/determinism/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/exactExports/a.js b/tasks/vendor/commonjs-tests/modules/1.0/exactExports/a.js
deleted file mode 100644
index 99c929e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/exactExports/a.js
+++ /dev/null
@@ -1,3 +0,0 @@
-exports.program = function () {
-    return require('program');
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/exactExports/program.js b/tasks/vendor/commonjs-tests/modules/1.0/exactExports/program.js
deleted file mode 100644
index e82bd6d..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/exactExports/program.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var test = require('test');
-var a = require('a');
-test.assert(a.program() === exports, 'exact exports');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/exactExports/test.js b/tasks/vendor/commonjs-tests/modules/1.0/exactExports/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/exactExports/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/hasOwnProperty.js b/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/hasOwnProperty.js
deleted file mode 100644
index e69de29..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/hasOwnProperty.js
+++ /dev/null
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/program.js b/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/program.js
deleted file mode 100644
index 1653f1b..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/program.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var hasOwnProperty = require('hasOwnProperty');
-var toString = require('toString');
-var test = require('test');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/test.js b/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/toString.js b/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/toString.js
deleted file mode 100644
index e69de29..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/hasOwnProperty/toString.js
+++ /dev/null
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/method/a.js b/tasks/vendor/commonjs-tests/modules/1.0/method/a.js
deleted file mode 100644
index 69c48af..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/method/a.js
+++ /dev/null
@@ -1,12 +0,0 @@
-exports.foo = function () {
-    return this;
-};
-exports.set = function (x) {
-    this.x = x;
-};
-exports.get = function () {
-    return this.x;
-};
-exports.getClosed = function () {
-    return exports.x;
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/method/program.js b/tasks/vendor/commonjs-tests/modules/1.0/method/program.js
deleted file mode 100644
index 192811c..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/method/program.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var test = require('test');
-var a = require('a');
-var foo = a.foo;
-test.assert(a.foo() == a, 'calling a module member');
-test.assert(foo() == (function (){return this})(), 'members not implicitly bound');
-a.set(10);
-test.assert(a.get() == 10, 'get and set')
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/method/test.js b/tasks/vendor/commonjs-tests/modules/1.0/method/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/method/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/missing/program.js b/tasks/vendor/commonjs-tests/modules/1.0/missing/program.js
deleted file mode 100644
index c6b03aa..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/missing/program.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var test = require('test');
-try {
-    require('bogus');
-    test.print('FAIL require throws error when module missing', 'fail');
-} catch (exception) {
-    test.print('PASS require throws error when module missing', 'pass');
-}
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/missing/test.js b/tasks/vendor/commonjs-tests/modules/1.0/missing/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/missing/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/monkeys/a.js b/tasks/vendor/commonjs-tests/modules/1.0/monkeys/a.js
deleted file mode 100644
index a949e1d..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/monkeys/a.js
+++ /dev/null
@@ -1 +0,0 @@
-require('program').monkey = 10;
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/monkeys/program.js b/tasks/vendor/commonjs-tests/modules/1.0/monkeys/program.js
deleted file mode 100644
index 42d6711..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/monkeys/program.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var a = require('a');
-var test = require('test');
-test.assert(exports.monkey == 10, 'monkeys permitted');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/monkeys/test.js b/tasks/vendor/commonjs-tests/modules/1.0/monkeys/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/monkeys/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/nested/a/b/c/d.js b/tasks/vendor/commonjs-tests/modules/1.0/nested/a/b/c/d.js
deleted file mode 100644
index 69fd282..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/nested/a/b/c/d.js
+++ /dev/null
@@ -1,3 +0,0 @@
-exports.foo = function () {
-    return 1;
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/nested/program.js b/tasks/vendor/commonjs-tests/modules/1.0/nested/program.js
deleted file mode 100644
index c014b57..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/nested/program.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var test = require('test');
-test.assert(require('a/b/c/d').foo() == 1, 'nested module identifier');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/nested/test.js b/tasks/vendor/commonjs-tests/modules/1.0/nested/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/nested/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/relative/program.js b/tasks/vendor/commonjs-tests/modules/1.0/relative/program.js
deleted file mode 100644
index b3e4b6e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/relative/program.js
+++ /dev/null
@@ -1,5 +0,0 @@
-var test = require('test');
-var a = require('submodule/a');
-var b = require('submodule/b');
-test.assert(a.foo == b.foo, 'a and b share foo through a relative require');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/relative/submodule/a.js b/tasks/vendor/commonjs-tests/modules/1.0/relative/submodule/a.js
deleted file mode 100644
index 42e4ca0..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/relative/submodule/a.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.foo = require('./b').foo;
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/relative/submodule/b.js b/tasks/vendor/commonjs-tests/modules/1.0/relative/submodule/b.js
deleted file mode 100644
index 9042c16..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/relative/submodule/b.js
+++ /dev/null
@@ -1,2 +0,0 @@
-exports.foo = function () {
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/relative/test.js b/tasks/vendor/commonjs-tests/modules/1.0/relative/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/relative/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/transitive/a.js b/tasks/vendor/commonjs-tests/modules/1.0/transitive/a.js
deleted file mode 100644
index 4df7bb8..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/transitive/a.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.foo = require('b').foo;
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/transitive/b.js b/tasks/vendor/commonjs-tests/modules/1.0/transitive/b.js
deleted file mode 100644
index 30ea70d..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/transitive/b.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.foo = require('c').foo;
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/transitive/c.js b/tasks/vendor/commonjs-tests/modules/1.0/transitive/c.js
deleted file mode 100644
index 69fd282..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/transitive/c.js
+++ /dev/null
@@ -1,3 +0,0 @@
-exports.foo = function () {
-    return 1;
-};
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/transitive/program.js b/tasks/vendor/commonjs-tests/modules/1.0/transitive/program.js
deleted file mode 100644
index 98bb996..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/transitive/program.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var test = require('test');
-test.assert(require('a').foo() == 1, 'transitive');
-test.print('DONE', 'info');
diff --git a/tasks/vendor/commonjs-tests/modules/1.0/transitive/test.js b/tasks/vendor/commonjs-tests/modules/1.0/transitive/test.js
deleted file mode 100644
index 5d0984e..0000000
--- a/tasks/vendor/commonjs-tests/modules/1.0/transitive/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-exports.print = typeof print !== "undefined" ? print : function () {
-    var system = require("system");
-    var stdio = system.stdio;
-    stdio.print.apply(stdio, arguments);
-};
-
-exports.assert = function (guard, message) {
-    if (guard) {
-        exports.print('PASS ' + message, 'pass');
-    } else {
-        exports.print('FAIL ' + message, 'fail');
-    }
-};
-
diff --git a/test/commonjs/.gitignore b/test/commonjs/.gitignore
deleted file mode 100644
index c585e19..0000000
--- a/test/commonjs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-out
\ No newline at end of file
diff --git a/test/commonjs/README.txt b/test/commonjs/README.txt
deleted file mode 100644
index 16cb81f..0000000
--- a/test/commonjs/README.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-This directory contains tests for the CommonJS functionality in Cordova.
-
-The tests come from the GitHub project https://github.com/commonjs/commonjs
-
-To run the tests, first you need to build them.
-
-Open a shell, cd into this directory, and run `python build-tests.py`.
-
-This will generate a set of HTML files which will run the tests within
-a browser.  More instructions on how to run the tests are printed
-after the tests are built.
\ No newline at end of file
diff --git a/test/commonjs/build-tests.py b/test/commonjs/build-tests.py
deleted file mode 100755
index e94744e..0000000
--- a/test/commonjs/build-tests.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/env python
-
-# ---
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ---
-
-import os
-import re
-import sys
-import shutil
-import datetime
-import subprocess
-
-PROGRAM = sys.argv[0]
-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def main():
-
-    # all work done in directory of this program
-    baseDir  = os.path.dirname(PROGRAM)
-    os.chdir(baseDir)
-
-    testsDir = os.path.abspath("../../thirdparty/commonjs-tests")
-    outDir   = os.path.abspath("out")
-
-    # validate testsDir
-    if not os.path.exists(testsDir):
-        error("tests dir does not exist: %s" % testsDir)
-    
-    if not os.path.isdir(testsDir):
-        error("tests dir is not a directory: %s" % testsDir)
-
-    # validate and reset outDir
-    if os.path.exists(outDir):
-        if not os.path.isdir(outDir):
-            error("out dir is not a directory: %s" % outDir)
-
-        shutil.rmtree(outDir)
-        
-    os.makedirs(outDir)
-
-    tests = getTests(testsDir)
-    
-    # now all work done in outDir
-    os.chdir("out")
-
-    # build the individual tests
-    iframes = []
-    for test in tests:
-        testName = test.replace('/', '-')
-        htmlFile = buildTest(os.path.join(testsDir, test), testName)
-        iframes.append("<iframe width='100%%' height='30' src='%s'></iframe>" % htmlFile)
-
-    iframesLines = "\n".join(iframes)
-    
-    # build the browser launcher
-    html = fileContents("../launcher-main.template.html")
-
-    html = html.replace("@iframes@", iframesLines)
-    html = html.replace("@date@", getDate())
-    
-    oFileName = "launcher-all.html"
-    oFile = file(oFileName, "w")
-    oFile.write(html)
-    oFile.close()
-    
-    print
-    print "Generated browser test: %s" % os.path.abspath(oFileName)
-    print 
-    print "You can run the test as a local file under Safari but not Chrome."
-    print "To test under Chrome, access the files via http://"
-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def buildTest(testDir, testName):
-
-    log("generating tests for %s" % (testName))
-
-    html = fileContents("../launcher-in-iframe.template.html")
-    
-    # get the list of modules
-    modules = getModules(testDir)
-    
-    modulesSource = []
-    
-    modulesSource.append("try {")
-    
-    for module in modules:
-        source = fileContents("%s.js" % os.path.join(testDir, module))
-        
-        modulesSource.append("//----------------------------------------------")
-        modulesSource.append("define('%s', function(require,exports,module) {" % module)
-        modulesSource.append(source.strip())
-        modulesSource.append("});")
-        modulesSource.append("")
-
-    modulesSource.append("}")
-    modulesSource.append("catch(e) {")
-    modulesSource.append("   console.log('exception thrown loading modules: ' + e)")
-    modulesSource.append("}")
-        
-    modulesLines = "\n".join(modulesSource)
-    
-    html = html.replace("@modules@", modulesLines)
-    html = html.replace("@title@", testName)
-    html = html.replace("@date@", getDate())
-
-    # build HTML launcher for iframe
-    oFileName = "%s.html" % testName
-    oFile = file(oFileName, "w")
-    oFile.write(html)
-    oFile.close()
-    
-    return oFileName
-    
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def getModules(testDir):
-    modules = []
-    for root, dirs, files in os.walk(testDir):
-        for file in files:
-            if not file.endswith(".js"): continue
-            
-            moduleSource = os.path.relpath(os.path.join(root, file), testDir)
-            moduleName   = os.path.splitext(moduleSource)[0]
-            modules.append(moduleName)
-
-    return modules
-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def getTests(testDir):
-    tests = []
-    for root, dirs, files in os.walk(testDir):
-        if "program.js" in files:
-            tests.append(os.path.relpath(root, testDir))
-            
-    return tests
-    
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def run(cmdArgs):
-    result = subprocess.Popen(cmdArgs, stdout=subprocess.PIPE).communicate()[0]
-    if not re.match(r"\s*", result):
-        print result
-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def fileContents(iFileName):
-    iFile = file(iFileName)
-    contents = iFile.read()
-    iFile.close()
-    
-    return contents
-
-def getDate():
-     return datetime.datetime.today().isoformat(" ")
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def log(message):
-    print "%s: %s" % (PROGRAM, message)
-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-def error(message):
-    log(message)
-    exit(1)
-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-main()
\ No newline at end of file
diff --git a/test/commonjs/launcher-in-iframe.template.html b/test/commonjs/launcher-in-iframe.template.html
deleted file mode 100644
index 62d5ea8..0000000
--- a/test/commonjs/launcher-in-iframe.template.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!doctype html>
-
-<!--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
--->
-
-<html>
-<head>
-<title>@title@</title>
-<script src='../../../lib/require.js'></script>
-<script>
-@modules@
-
-//----------------------------------------------------------------------------
-var outputPre
-
-window.addEventListener("load", onLoad, false)
-
-//----------------------------------------------------------------------------
-function onLoad() {
-    outputPre = document.getElementById("output")
-
-    if (window.parent !== window) {
-        window.parent.testsStarting("@title@")
-    }
-    
-    try {
-        require("program")
-    }
-    catch (e) {
-        print ("FAIL exception thrown: " + e)
-    }
-}
-
-//----------------------------------------------------------------------------
-function print(message, status) {
-
-    var className
-    
-    if      (/^PASS/.exec(message)) className = "pass"
-    else if (/^FAIL/.exec(message)) className = "fail"
-    else                            className = "info"
-    
-    var line = "<div class='" + className + "'>" + message + "</div>"
-    outputPre.innerHTML += line
-    
-    if (window.parent !== window) {
-        window.parent.oneTestComplete(className, message)
-    }
-    
-}
-</script>
-</head>
-<body>
-<p>Tests generated on @date@
-<pre id="output"></pre>
-</body>
-</html>
diff --git a/test/commonjs/launcher-main.template.html b/test/commonjs/launcher-main.template.html
deleted file mode 100644
index 56014c7..0000000
--- a/test/commonjs/launcher-main.template.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!doctype html>
-
-<!--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
--->
-
-<html>
-<head>
-<link href="../test.css" rel="stylesheet" type="text/css">
-<script>
-var outputDiv
-var queue = []
-
-window.addEventListener("load", onLoad, false)
-
-//----------------------------------------------------------------------------
-function onLoad() {
-    outputDiv = document.getElementById("output")
-
-    if (queue.length > 0) {
-        outputDiv.innerHTML += queue.join("\n")
-        queue = []
-    }
-    
-}
-
-//----------------------------------------------------------------------------
-function testsStarting(url) {
-    output = "<div class='test'>" + url + "</div>"
-    
-    if (!outputDiv) {
-        queue.push(output)
-    }
-    else {
-        outputDiv.innerHTML += output
-    }
-}
-
-//----------------------------------------------------------------------------
-function oneTestComplete(status, message) {
-    output = "<div class='" + status + "'>" + message + "</div>"
-
-    if (!outputDiv) {
-        queue.push(output)
-    }
-    else {
-        outputDiv.innerHTML += output
-    }
-}
-</script>
-</head>
-<body>
-<p>Tests generated on @date@
-<div id="output"></div>
-<div style="display:none" id="iframes">
-@iframes@
-</div>
-</body>
-</html>
diff --git a/test/commonjs/test.css b/test/commonjs/test.css
deleted file mode 100644
index 4b118a1..0000000
--- a/test/commonjs/test.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-# ---
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ---
-*/
-
-.pass, .fail, .info {
-    font-family:      monospace;
-    margin-left:      1em;
-}
-
-.pass {
-    background-color: #DFD;
-}
-
-.fail {
-    background-color: #F88;
-}
-
-.info {
-    background-color: #DDF;
-}
-
-.test {
-    margin-top:  1em;
-    font-weight: bold;
-    font-size:   120%;
-}
diff --git a/test/test.require.js b/test/test.require.js
index 63de799..b66e9ab 100644
--- a/test/test.require.js
+++ b/test/test.require.js
@@ -154,5 +154,91 @@
             });
             expect(require('plugin.ios.foo')).toEqual(4);
         });
+
+        // Adapted version of CommonJS test `determinism`
+        it('Test#013 : does not fall back to relative modules when absolutes are not available', () => {
+            define('submodule.a', function (require, exports, module) {
+                expect(() => {
+                    require('a');
+                }).toThrow('module a not found');
+            });
+
+            require('submodule.a');
+        });
+
+        // Adapted version of CommonJS test `absolute`
+        it('Test#014 : correctly handles non-trivial dependecy graphs', () => {
+            define('submodule/a', function (require, exports, module) {
+                exports.foo = () => require('b');
+            });
+            define('b', function (require, exports, module) {
+                exports.foo = () => {};
+            });
+
+            const a = require('submodule/a');
+            const b = require('b');
+            expect(a.foo().foo).toBe(b.foo);
+        });
+
+        // Adapted version of CommonJS test `transitive`
+        it('Test#015 : correctly handles transitive dependecies', () => {
+            define('a', function (require, exports, module) {
+                exports.foo = require('b').foo;
+            });
+            define('b', function (require, exports, module) {
+                exports.foo = require('c').foo;
+            });
+            define('c', function (require, exports, module) {
+                exports.foo = () => 1;
+            });
+
+            expect(require('a').foo()).toBe(1);
+        });
+
+        // Adapted version of CommonJS test `method`
+        it('Test#016 : does not bind members of `exports` implicitly', () => {
+            define('a', function (require, exports, module) {
+                module.exports = {
+                    foo () { return this; },
+                    set (x) { this.x = x; },
+                    get () { return this.x; },
+                    getClosed () { return module.exports.x; }
+                };
+            });
+
+            const a = require('a');
+            const { foo, getClosed } = a;
+
+            expect(a.foo()).toBe(a);
+            expect(foo()).toBe((function () { return this; })());
+
+            a.set(10);
+            expect(a.get()).toBe(10);
+            expect(getClosed()).toBe(10);
+        });
+
+        // Adapted version of CommonJS test `nested`
+        it('Test#017 : allows any strings as module names', () => {
+            define('a/b/c/d', function (require, exports, module) {
+                exports.foo = () => 1;
+            });
+            define('ラーメン', function (require, exports, module) {
+                exports.foo = () => 2;
+            });
+
+            expect(require('a/b/c/d').foo()).toBe(1);
+            expect(require('ラーメン').foo()).toBe(2);
+        });
+
+        // Adapted version of CommonJS test `hasOwnProperty`
+        xit('Test#018 : allows properties of Object.prototype as module names', () => {
+            expect(() => {
+                define('hasOwnProperty', jasmine.createSpy());
+            }).not.toThrow();
+
+            expect(() => {
+                define('toString', jasmine.createSpy());
+            }).not.toThrow();
+        });
     });
 });