Skip to content
This repository
  • 2 commits
  • 4 files changed
  • 0 comments
  • 2 contributors
Mar 08, 2012
Dane Springmeyer allow the tests to work (with both node v4 and v6) without placing bo…
…nes copy into the node_modules folder
984b533
Jul 18, 2012
Merge branch 'master' into relative-require
Conflicts:
	bones.js
	test/assets.test.js
d579e5b
18  bones.js
@@ -7,18 +7,18 @@ exports.$ = require('jquery');
7 7
 exports._ = require('underscore');
8 8
 exports.mirror = require('mirror');
9 9
 
10  
-exports.utils = require('bones/server/utils');
11  
-exports.middleware = require('bones/server/middleware');
  10
+exports.utils = require('./server/utils');
  11
+exports.middleware = require('./server/middleware');
12 12
 
13 13
 exports.server = true;
14 14
 
15  
-exports.Backbone = require('bones/server/backbone');
16  
-exports.Router = require('bones/server/router');
17  
-exports.Model = require('bones/server/model');
18  
-exports.Collection = require('bones/server/collection');
19  
-exports.View = require('bones/server/view');
20  
-exports.Server = require('bones/server/server');
21  
-exports.Command = require('bones/server/command');
  15
+exports.Backbone = require('./server/backbone');
  16
+exports.Router = require('./server/router');
  17
+exports.Model = require('./server/model');
  18
+exports.Collection = require('./server/collection');
  19
+exports.View = require('./server/view');
  20
+exports.Server = require('./server/server');
  21
+exports.Command = require('./server/command');
22 22
 
23 23
 exports.load = function(dir) {
24 24
     return exports.plugin.load(dir);
2  package.json
@@ -21,7 +21,7 @@
21 21
     },
22 22
 
23 23
     "scripts": {
24  
-        "test": "expresso -I ..",
  24
+        "test": "NODE_PATH=.:$NODE_PATH expresso -I ..",
25 25
         "coverage": "./test/coverage.sh"
26 26
     },
27 27
     "engines": {
12  servers/Route.bones
@@ -12,15 +12,15 @@ var options = {
12 12
 // TODO: This should be moved to the initialize method!
13 13
 server.prototype.assets = {
14 14
     vendor: new mirror([
15  
-        require.resolve('bones/assets/jquery'),
  15
+        require.resolve('../assets/jquery'),
16 16
         require.resolve('underscore'),
17 17
         require.resolve('backbone')
18 18
     ], { type: '.js' }),
19 19
     core: new mirror([
20  
-        require.resolve('bones/shared/utils'),
21  
-        require.resolve('bones/client/utils'),
22  
-        require.resolve('bones/shared/backbone'),
23  
-        require.resolve('bones/client/backbone')
  20
+        require.resolve('../shared/utils'),
  21
+        require.resolve('../client/utils'),
  22
+        require.resolve('../shared/backbone'),
  23
+        require.resolve('../client/backbone')
24 24
     ], { type: '.js' }),
25 25
     models: new mirror([], options),
26 26
     views: new mirror([], options),
@@ -29,7 +29,7 @@ server.prototype.assets = {
29 29
 };
30 30
 
31 31
 if (env === 'development') {
32  
-    server.prototype.assets.core.unshift(require.resolve('bones/assets/debug'));
  32
+    server.prototype.assets.core.unshift(require.resolve('../assets/debug'));
33 33
 }
34 34
 
35 35
 // TODO: This should be moved to the initialize method!
38  test/assets.test.js
@@ -27,10 +27,10 @@ exports['/assets/bones/core.js'] = function() {
27 27
         url: '/assets/bones/core.js',
28 28
         method: 'GET'
29 29
     }, { status: 200 }, function(res) {
30  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/client/backbone.js'))) >= 0);
31  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/client/utils.js'))) >= 0);
32  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/shared/backbone.js'))) >= 0);
33  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/shared/utils.js'))) >= 0);
  30
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../client/backbone.js'))) >= 0);
  31
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../client/utils.js'))) >= 0);
  32
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../shared/backbone.js'))) >= 0);
  33
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../shared/utils.js'))) >= 0);
34 34
     });
35 35
 };
36 36
 
@@ -39,7 +39,7 @@ exports['/assets/bones/core.js'] = function() {
39 39
         url: '/assets/bones/vendor.js',
40 40
         method: 'GET'
41 41
     }, { status: 200 }, function(res) {
42  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/assets/jquery.js'))) >= 0);
  42
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../assets/jquery.js'))) >= 0);
43 43
         assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('backbone'))) >= 0);
44 44
         assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('underscore'))) >= 0);
45 45
     });
@@ -50,8 +50,8 @@ exports['/assets/bones/routers.js'] = function() {
50 50
         url: '/assets/bones/routers.js',
51 51
         method: 'GET'
52 52
     }, { status: 200 }, function(res) {
53  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/node_modules/submodule/routers/Foo'))) >= 0);
54  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/routers/Page'))) >= 0);
  53
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/node_modules/submodule/routers/Foo'))) >= 0);
  54
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/routers/Page'))) >= 0);
55 55
 
56 56
         // Correct order.
57 57
         assert.ok(res.body.indexOf('// ---- start test/fixture/node_modules/submodule/routers/Foo.bones ----') >= 0);
@@ -69,14 +69,14 @@ exports['/assets/bones/models.js'] = function() {
69 69
         url: '/assets/bones/models.js',
70 70
         method: 'GET'
71 71
     }, { status: 200 }, function(res) {
72  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/models/Failure'))) >= 0);
73  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/models/Failures'))) >= 0);
74  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/models/House'))) >= 0);
75  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/models/Houses'))) >= 0);
76  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/models/Page'))) >= 0);
  72
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/models/Failure'))) >= 0);
  73
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/models/Failures'))) >= 0);
  74
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/models/House'))) >= 0);
  75
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/models/Houses'))) >= 0);
  76
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/models/Page'))) >= 0);
77 77
 
78 78
         // Doesn't include server files.
79  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/models/Page.server'))) < 0);
  79
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/models/Page.server'))) < 0);
80 80
 
81 81
         // Correct order.
82 82
         assert.ok(res.body.indexOf('// ---- start test/fixture/models/Failure.bones ----') >= 0);
@@ -97,11 +97,11 @@ exports['/assets/bones/views.js'] = function() {
97 97
         url: '/assets/bones/views.js',
98 98
         method: 'GET'
99 99
     }, { status: 200 }, function(res) {
100  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/views/Error'))) >= 0);
101  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/views/App'))) >= 0);
  100
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/views/Error'))) >= 0);
  101
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/views/App'))) >= 0);
102 102
 
103 103
         // Doesn't include server files.
104  
-        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('bones/test/fixture/views/App.server'))) < 0);
  104
+        assert.ok(res.body.indexOf(fs.readFileSync(require.resolve('../test/fixture/views/App.server'))) < 0);
105 105
 
106 106
         // Correct order.
107 107
         assert.ok(res.body.indexOf('// ---- start test/fixture/views/Error.bones ----') >= 0);
@@ -115,11 +115,11 @@ exports['/assets/bones/templates.js'] = function() {
115 115
         url: '/assets/bones/templates.js',
116 116
         method: 'GET'
117 117
     }, { status: 200 }, function(res) {
118  
-        assert.ok(res.body.indexOf(require('bones/test/fixture/templates/Error._').toString()) >= 0);
119  
-        assert.ok(res.body.indexOf(require('bones/test/fixture/node_modules/othermodule/templates/Other._').toString()) >= 0);
  118
+        assert.ok(res.body.indexOf(require('../test/fixture/templates/Error._').toString()) >= 0);
  119
+        assert.ok(res.body.indexOf(require('../test/fixture/node_modules/othermodule/templates/Other._').toString()) >= 0);
120 120
 
121 121
         // Doesn't include server files.
122  
-        assert.ok(res.body.indexOf(require('bones/test/fixture/templates/ServerSide.server._').toString()) < 0);
  122
+        assert.ok(res.body.indexOf(require('../test/fixture/templates/ServerSide.server._').toString()) < 0);
123 123
 
124 124
         // Correct order.
125 125
         assert.ok(res.body.indexOf('// ---- start test/fixture/templates/Error._ ----') >= 0);

No commit comments for this range

Something went wrong with that request. Please try again.