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

Unified Diff: test_wrapper.js

Issue 29336430: Issue 3659 - Remove locale dependency from filter classes (Closed)
Patch Set: Created Feb. 16, 2016, 11:45 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/filterClasses.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test_wrapper.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/test_wrapper.js
@@ -0,0 +1,24 @@
+#!/usr/bin/env node --harmony
+"use strict";
+
+require("node-babel")({
+ extensions: [".js"]
+});
+
+// HACK: override Node's module resolution to match the way bootstrap.js
+// resolves modules right now.
+let fs = require("fs");
+let knownModules = fs.readdirSync("lib").map(f => f.replace(/\.js$/, ""));
+knownModules = new Set(knownModules);
+
+let nodeModule = require("module");
+let origResolve = nodeModule._resolveFilename;
+nodeModule._resolveFilename = function()
+{
+ let params = Array.slice(arguments);
+ if (knownModules.has(params[0]))
+ params[0] = "./" + params[0];
+ return origResolve.apply(this, params);
+};
+
+require("./node_modules/.bin/nodeunit");
« no previous file with comments | « test/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld