Skip to content

Commit b9b2f7e

Browse files
committed
Local test fixes.
- Update dependencies. - Add express and cors. - Use local path for test baseIri. - Update test runner to use newer express and cors module.
1 parent 48b9ae9 commit b9b2f7e

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@
3131
"xmldom": "0.1.19"
3232
},
3333
"devDependencies": {
34-
"chai": "^3.2.0",
34+
"chai": "^3.4.1",
3535
"commander": "^2.8.0",
36+
"cors": "^2.7.1",
37+
"express": "^4.13.3",
3638
"istanbul": "^0.3.19",
37-
"jscs": "^2.1.1",
38-
"mocha": "^2.2.5",
39+
"jscs": "^2.8.0",
40+
"jshint": "^2.9.1",
41+
"mocha": "^2.3.4",
3942
"mocha-phantomjs": "~3.5.6",
4043
"phantomjs": "~1.9.18"
4144
},

tests/manifest.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@type": "mf:Manifest",
55
"name": "Custom jsonld.js Tests",
66
"description": "Custom jsonld.js Tests",
7-
"baseIri": "http://github.com/digitalbazaar/jsonld.js/",
7+
"baseIri": "./",
88
"sequence": [{
99
"@id": "#t0001",
1010
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],

tests/remote-context-server.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1+
var cors = require('cors');
12
var express = require('express');
23
var path = require('path');
34

4-
var server = express();
5+
var app = express();
56

6-
server.configure(function() {
7-
server.use(express.methodOverride());
8-
server.use(CORS);
9-
server.use(express.static(path.resolve(path.join(__dirname, 'contexts'))));
10-
});
11-
12-
// use CORS
13-
function CORS(req, res, next) {
14-
res.header('Access-Control-Allow-Origin', '*');
15-
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
16-
res.header('Access-Control-Allow-Headers', 'Content-Type');
17-
next();
18-
}
7+
app.use(cors());
8+
app.use(express.static(path.resolve(path.join(__dirname, 'contexts'))));
199

20-
server.listen(8000);
21-
console.log('Remote context test server running...');
10+
var port = 8000;
11+
app.listen(port, function() {
12+
console.log('Remote context test server running on port ' + port + '...');
13+
});

0 commit comments

Comments
 (0)