Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: test_wrapper.js

Issue 29336430: Issue 3659 - Remove locale dependency from filter classes (Closed)
Left Patch Set: Added missing license header Created Feb. 16, 2016, 11:58 a.m.
Right Patch Set: Simplified test setup Created Feb. 17, 2016, 3:52 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/filterClasses.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/usr/bin/env node --harmony
Thomas Greiner 2016/02/17 15:32:50 Detail: Seems a bit redundant to specify it here a
Wladimir Palant 2016/02/17 15:53:01 Right, this file was originally run directly - it
2 "use strict"; 1 "use strict";
3 2
4 require("node-babel")({ 3 require("node-babel")();
5 extensions: [".js"]
6 });
7
8 // HACK: override Node's module resolution to match the way bootstrap.js
9 // resolves modules right now.
Thomas Greiner 2016/02/17 15:32:50 You can simply set the "NODE_PATH" environment var
Wladimir Palant 2016/02/17 15:53:01 Nice catch, originally this wasn't possible as the
10 let fs = require("fs");
11 let knownModules = fs.readdirSync("lib").map(f => f.replace(/\.js$/, ""));
12 knownModules = new Set(knownModules);
13
14 let nodeModule = require("module");
15 let origResolve = nodeModule._resolveFilename;
16 nodeModule._resolveFilename = function()
17 {
18 let params = Array.slice(arguments);
19 if (knownModules.has(params[0]))
20 params[0] = "./" + params[0];
21 return origResolve.apply(this, params);
22 };
23 4
24 require("./node_modules/.bin/nodeunit"); 5 require("./node_modules/.bin/nodeunit");
LEFTRIGHT

Powered by Google App Engine
This is Rietveld