Permalink
Browse files

deleted irrelevant tests, subdep tests now work

  • Loading branch information...
1 parent 27b7071 commit c20957df55c76d526aff09a5c3ae0bd24dbf4ad5 @substack committed Jun 20, 2011
View
@@ -16,7 +16,6 @@ var exports = module.exports = function (opts) {
throw new Error('base is no longer a valid parameter');
}
-console.dir(opts.ignore);
var w = wrap(opts.require, opts.ignore);
if (opts.entry) {
View
@@ -1,43 +0,0 @@
-var assert = require('assert');
-var browserify = require('browserify');
-var vm = require('vm');
-var Hash = require('hashish');
-
-exports.modules = function () {
- var src = browserify.bundle({
- base : {
- 'foomoduletest' : __dirname + '/modules/foomoduletest'
- },
- });
-
- assert.ok(typeof src === 'string');
- assert.ok(src.length > 0);
-
- var c = {};
- vm.runInNewContext(src, c);
- assert.eql(c.require('foomoduletest').bar, 55)
-};
-
-exports.precedence = function () {
- var src = browserify.bundle({
- base : __dirname + '/modules/precedence',
- require : [ 'hashish', 'traverse' ],
- });
-
- var c = { console : console };
- vm.runInNewContext(src, c);
- assert.ok(c.require.modules['hashish/package.json']);
- assert.deepEqual(
- c.require.modules['hashish/index.js']().map(
- { a : 1, b :2 }, function (x) { return x * 100 }
- ),
- { a : 100, b : 200 }
- );
- assert.ok(c.require.modules['./node_modules/hashish/index.js']);
- assert.notEqual(
- c.require.modules['hashish/index.js'](),
- c.require('hashish')
- );
- assert.equal(c.require('./x'), 'meow!');
- assert.equal(c.require('hashish'), 'meow');
-};
@@ -1 +0,0 @@
-exports.bar = require('barmoduletest');

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,8 +0,0 @@
-{
- "name" : "foomoduletest",
- "version" : "0.0.1",
- "main" : "./index.js",
- "dependencies" : {
- "barmoduletest" : "=0.0.x"
- }
-}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1 +0,0 @@
-module.exports = require('hashish') + '!';
View
@@ -1,33 +0,0 @@
-var assert = require('assert');
-var browserify = require('browserify');
-var vm = require('vm');
-
-exports.multibaseObject = function () {
- var src = browserify.bundle({
- base : {
- foo : __dirname + '/pkg/a',
- bar : __dirname + '/pkg/b',
- },
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('foo/moo').zzz(3), 333);
- assert.eql(c.require("bar").zzz(3), 333);
-};
-
-exports.multibaseArray = function () {
- var src = browserify.bundle({
- base : [
- __dirname + '/pkg/a',
- __dirname + '/pkg/c',
- ],
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require("./moo").zzz(3), 333);
- assert.eql(c.require("./").fn(3), 300);
-};
View
@@ -1,29 +0,0 @@
-var assert = require('assert');
-var browserify = require('browserify');
-var vm = require('vm');
-
-exports.named = function () {
- var src = browserify.bundle({
- base : { names : __dirname + '/names' }
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('names').names, {
- __dirname : 'names',
- __filename : 'names/index.js',
- });
-};
-
-exports.names = function () {
- var src = browserify.bundle(__dirname + '/names');
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('./index').names, {
- __dirname : '.',
- __filename : './index.js',
- });
-};
View
@@ -1,4 +0,0 @@
-exports.names = {
- __dirname : __dirname,
- __filename : __filename,
-};
View
@@ -1,175 +0,0 @@
-var assert = require('assert');
-var browserify = require('browserify');
-var vm = require('vm');
-var EventEmitter = require('events').EventEmitter;
-
-exports.bundleA = function () {
- var src = browserify.bundle(__dirname + '/pkg/a');
-
- var c = {};
- vm.runInNewContext(src, c);
- assert.eql(c.require("./moo").zzz(3), 333);
-};
-
-exports.namedA = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- base : __dirname + '/pkg/a',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
- assert.eql(c.require("wowsy/moo").zzz(3), 333);
-};
-
-exports.namedMainA = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- main : './moo.js',
- base : __dirname + '/pkg/a',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
- assert.eql(c.require("wowsy").zzz(3), 333);
- assert.ok(c.require.modules['wowsy/moo.js']);
-};
-
-exports.namedMainAbsA = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- main : __dirname + '/pkg/a/moo.js',
- base : __dirname + '/pkg/a',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require("wowsy").zzz(3), 333);
- assert.ok(c.require.modules['wowsy/moo.js']);
-};
-
-exports.namedMainNonBaseA = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- main : __dirname + '/pkg/a/moo.js',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require("wowsy").zzz(3), 333);
- assert.ok(
- c.require.modules['wowsy/moo']
- || c.require.modules['wowsy/moo.js']
- );
-};
-
-exports.bundleB = function () {
- var src = browserify.bundle(__dirname + '/pkg/b');
-
- var c = {};
- vm.runInNewContext(src, c);
- assert.eql(c.require('.').zzz(3), 333);
-};
-
-exports.namedB = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- base : __dirname + '/pkg/b',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require("wowsy").zzz(3), 333);
- assert.ok(!c.require.modules["$$$"]);
-};
-
-exports.namedMainB = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- main : './moo.js',
- base : __dirname + '/pkg/a',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('wowsy').zzz(3), 333);
- assert.ok(c.require.modules['wowsy/moo.js']);
-};
-
-exports.bundleC = function () {
- var src = browserify.bundle(__dirname + '/pkg/c');
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('./').fn(3), 300);
- assert.eql(
- Object.keys(c.require.modules)
- .filter(function (name) { return name.match(/doom/) })
- , [ './doom.js', './doom-browser.js' ]
- );
-
- assert.ok(!c.require.modules['seq']);
-};
-
-exports.namedMainRelativeD = function () {
- var src = browserify.bundle({
- name : 'wowsy',
- main : __dirname + '/pkg/d/foo.js',
- base : __dirname + '/pkg/d',
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require("wowsy/bar")(), 333);
- assert.eql(c.require("wowsy")(), 444);
- assert.eql(c.require("wowsy/foo")(), 444);
-};
-
-exports.innerRequireModules = function () {
- var src = browserify.bundle({
- base : __dirname + '/pkg/e',
- });
-
- var c = { assert : assert };
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('./inner')(assert), 555);
-};
-
-exports.invalidJSON = function () {
- var src = browserify.bundle({
- base : { f : __dirname + '/pkg/f' },
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('f')(), 555);
-};
-
-exports.trapInvalidJSON = function () {
- var ee = new EventEmitter;
- var to = setTimeout(function () {
- assert.fail('never caught syntax error from faulty json');
- }, 5000);
-
- ee.on('syntaxError', function () {
- clearTimeout(to);
- });
-
- var src = browserify.bundle({
- base : { f : __dirname + '/pkg/f' },
- listen : ee,
- });
-
- var c = {};
- vm.runInNewContext(src, c);
-
- assert.eql(c.require('f')(), 555);
-};
View
@@ -1,3 +0,0 @@
-exports.zzz = function (x) {
- return x * 111;
-};
View
@@ -1,3 +0,0 @@
-exports.zzz = function (x) {
- return x * 111;
-};
View
@@ -1,8 +0,0 @@
-{
- "name" : "$$$",
- "version" : "0.0.1",
- "main" : "./moo.js",
- "dependencies" : {
- "hashish" : ">=0.0.3"
- }
-}
@@ -1 +0,0 @@
-exports.fn = function (x) { return x * 100 };
View
@@ -1 +0,0 @@
-exports.gloom = 789;
View
@@ -1,12 +0,0 @@
-{
- "name" : "doom",
- "version" : "0.0.1",
- "main" : "./doom.js",
- "dependencies" : {
- "hashish" : ">=0.0.3",
- "seq" : ">=0.1.7"
- },
- "browserify" : {
- "main" : "./doom-browser.js"
- }
-}
View
@@ -1 +0,0 @@
-exports.doom = 555;
View
@@ -1,3 +0,0 @@
-module.exports = function () {
- return require('./foo')() - 111
-};
View
@@ -1,3 +0,0 @@
-module.exports = function () {
- return 444;
-};
View
@@ -1,6 +0,0 @@
-module.exports = function (assert) {
- assert.ok(require.modules['./x.js'] || require.modules['./x']);
- assert.ok(require.modules['./inner.js'] || require.modules['./inner']);
-
- return 555;
-};
View
@@ -1 +0,0 @@
-module.exports = 'module x';
View
@@ -1,3 +0,0 @@
-module.exports = function () {
- return 555;
-};
View
@@ -1,2 +0,0 @@
-{
- invalid json woo
Oops, something went wrong.

0 comments on commit c20957d

Please sign in to comment.