diff --git a/packages/accounts-password/email_tests_setup.js b/packages/accounts-password/email_tests_setup.js index bf84839c35..30a542aa12 100644 --- a/packages/accounts-password/email_tests_setup.js +++ b/packages/accounts-password/email_tests_setup.js @@ -5,7 +5,7 @@ // var interceptedEmails = {}; // (email address) -> (array of contents) -_EmailTest.hookSend(function (options) { +EmailTest.hookSend(function (options) { var to = options.to; if (to.indexOf('intercept') === -1) { return true; // go ahead and send diff --git a/packages/ejson/base64.js b/packages/ejson/base64.js index 478538f917..795050bd43 100644 --- a/packages/ejson/base64.js +++ b/packages/ejson/base64.js @@ -122,6 +122,6 @@ base64Decode = function (str) { return arr; }; -_EJSONTest.base64Encode = base64Encode; +EJSONTest.base64Encode = base64Encode; -_EJSONTest.base64Decode = base64Decode; +EJSONTest.base64Decode = base64Decode; diff --git a/packages/ejson/base64_test.js b/packages/ejson/base64_test.js index e17519ea40..4847c2e59e 100644 --- a/packages/ejson/base64_test.js +++ b/packages/ejson/base64_test.js @@ -24,8 +24,8 @@ Tinytest.add("base64 - testing the test", function (test) { }); Tinytest.add("base64 - empty", function (test) { - test.equal(_EJSONTest.base64Encode(EJSON.newBinary(0)), ""); - test.equal(_EJSONTest.base64Decode(""), EJSON.newBinary(0)); + test.equal(EJSONTest.base64Encode(EJSON.newBinary(0)), ""); + test.equal(EJSONTest.base64Decode(""), EJSON.newBinary(0)); }); @@ -38,8 +38,8 @@ Tinytest.add("base64 - wikipedia examples", function (test) { {txt: "sure.", res: "c3VyZS4="} ]; _.each(tests, function(t) { - test.equal(_EJSONTest.base64Encode(asciiToArray(t.txt)), t.res); - test.equal(arrayToAscii(_EJSONTest.base64Decode(t.res)), t.txt); + test.equal(EJSONTest.base64Encode(asciiToArray(t.txt)), t.res); + test.equal(arrayToAscii(EJSONTest.base64Decode(t.res)), t.txt); }); }); @@ -49,11 +49,11 @@ Tinytest.add("base64 - non-text examples", function (test) { {array: [0, 0, 1], b64: "AAAB"} ]; _.each(tests, function(t) { - test.equal(_EJSONTest.base64Encode(t.array), t.b64); + test.equal(EJSONTest.base64Encode(t.array), t.b64); var expectedAsBinary = EJSON.newBinary(t.array.length); _.each(t.array, function (val, i) { expectedAsBinary[i] = val; }); - test.equal(_EJSONTest.base64Decode(t.b64), expectedAsBinary); + test.equal(EJSONTest.base64Decode(t.b64), expectedAsBinary); }); }); diff --git a/packages/ejson/ejson.js b/packages/ejson/ejson.js index b049fa3863..3bce3f802f 100644 --- a/packages/ejson/ejson.js +++ b/packages/ejson/ejson.js @@ -1,5 +1,5 @@ EJSON = {}; -_EJSONTest = {}; +EJSONTest = {}; var customTypes = {}; // Add a custom type, using a method of your choice to get to and diff --git a/packages/ejson/package.js b/packages/ejson/package.js index 7b4f238aa6..bad57cb9fb 100644 --- a/packages/ejson/package.js +++ b/packages/ejson/package.js @@ -6,7 +6,7 @@ Package.describe({ Package.on_use(function (api) { api.use(['json', 'underscore']); api.exportSymbol('EJSON'); - api.exportSymbol('_EJSONTest', {testOnly: true}); + api.exportSymbol('EJSONTest', {testOnly: true}); api.add_files('ejson.js', ['client', 'server']); api.add_files('base64.js', ['client', 'server']); }); diff --git a/packages/email/email.js b/packages/email/email.js index 65f2d66399..3efe822340 100644 --- a/packages/email/email.js +++ b/packages/email/email.js @@ -3,7 +3,7 @@ var urlModule = Npm.require('url'); var MailComposer = Npm.require('mailcomposer').MailComposer; Email = {}; -_EmailTest = {}; +EmailTest = {}; var makePool = function (mailUrlString) { var mailUrl = urlModule.parse(mailUrlString); @@ -49,12 +49,12 @@ var next_devmode_mail_id = 0; var output_stream = process.stdout; // Testing hooks -_EmailTest.overrideOutputStream = function (stream) { +EmailTest.overrideOutputStream = function (stream) { next_devmode_mail_id = 0; output_stream = stream; }; -_EmailTest.restoreOutputStream = function () { +EmailTest.restoreOutputStream = function () { output_stream = process.stdout; }; @@ -90,7 +90,7 @@ var smtpSend = function (mc) { * false to skip sending. */ var sendHooks = []; -_EmailTest.hookSend = function (f) { +EmailTest.hookSend = function (f) { sendHooks.push(f); }; diff --git a/packages/email/email_tests.js b/packages/email/email_tests.js index ac7aa4e320..1c367b2178 100644 --- a/packages/email/email_tests.js +++ b/packages/email/email_tests.js @@ -6,7 +6,7 @@ Tinytest.add("email - dev mode smoke test", function (test) { try { var stream = new streamBuffers.WritableStreamBuffer; - _EmailTest.overrideOutputStream(stream); + EmailTest.overrideOutputStream(stream); Email.send({ from: "foo@example.com", to: "bar@example.com", @@ -34,6 +34,6 @@ Tinytest.add("email - dev mode smoke test", function (test) { "From us.\r\n" + "====== END MAIL #0 ======\n"); } finally { - _EmailTest.restoreOutputStream(); + EmailTest.restoreOutputStream(); } }); diff --git a/packages/email/package.js b/packages/email/package.js index 27d22beb5f..f93cd39dad 100644 --- a/packages/email/package.js +++ b/packages/email/package.js @@ -9,7 +9,7 @@ Npm.depends({mailcomposer: "0.1.15", simplesmtp: "0.1.25", "stream-buffers": "0. Package.on_use(function (api) { api.use('underscore', 'server'); api.exportSymbol('Email', 'server'); - api.exportSymbol('_EmailTest', 'server', {testOnly: true}); + api.exportSymbol('EmailTest', 'server', {testOnly: true}); api.add_files('email.js', 'server'); }); diff --git a/packages/livedata/livedata_common.js b/packages/livedata/livedata_common.js index 8cff12ac7a..b39b65e491 100644 --- a/packages/livedata/livedata_common.js +++ b/packages/livedata/livedata_common.js @@ -2,7 +2,7 @@ DDP = {}; SUPPORTED_DDP_VERSIONS = [ 'pre1' ]; -_LivedataTest.SUPPORTED_DDP_VERSIONS = SUPPORTED_DDP_VERSIONS; +LivedataTest.SUPPORTED_DDP_VERSIONS = SUPPORTED_DDP_VERSIONS; MethodInvocation = function (options) { var self = this; diff --git a/packages/livedata/livedata_connection.js b/packages/livedata/livedata_connection.js index 839e9f383a..5b77ef16a6 100644 --- a/packages/livedata/livedata_connection.js +++ b/packages/livedata/livedata_connection.js @@ -1383,7 +1383,7 @@ _.extend(Connection.prototype, { } }); -_LivedataTest.Connection = Connection; +LivedataTest.Connection = Connection; // @param url {String} URL to Meteor app, // e.g.: diff --git a/packages/livedata/livedata_connection_tests.js b/packages/livedata/livedata_connection_tests.js index c2ff0c2f72..72d56d65cb 100644 --- a/packages/livedata/livedata_connection_tests.js +++ b/packages/livedata/livedata_connection_tests.js @@ -2,14 +2,14 @@ var newConnection = function (stream) { // Some of these tests leave outstanding methods with no result yet // returned. This should not block us from re-running tests when sources // change. - return new _LivedataTest.Connection(stream, {reloadWithOutstanding: true}); + return new LivedataTest.Connection(stream, {reloadWithOutstanding: true}); }; var makeConnectMessage = function (session) { var msg = { msg: 'connect', - version: _LivedataTest.SUPPORTED_DDP_VERSIONS[0], - support: _LivedataTest.SUPPORTED_DDP_VERSIONS + version: LivedataTest.SUPPORTED_DDP_VERSIONS[0], + support: LivedataTest.SUPPORTED_DDP_VERSIONS }; if (session) @@ -1345,12 +1345,12 @@ testAsyncMulti("livedata connection - reconnect to a different server", [ Tinytest.addAsync("livedata connection - version negotiation requires renegotiating", function (test, onComplete) { - var connection = new _LivedataTest.Connection(getSelfConnectionUrl(), { + var connection = new LivedataTest.Connection(getSelfConnectionUrl(), { reloadWithOutstanding: true, - supportedDDPVersions: ["garbled", _LivedataTest.SUPPORTED_DDP_VERSIONS[0]], + supportedDDPVersions: ["garbled", LivedataTest.SUPPORTED_DDP_VERSIONS[0]], onConnectionFailure: function () { test.fail(); onComplete(); }, onConnected: function () { - test.equal(connection._version, _LivedataTest.SUPPORTED_DDP_VERSIONS[0]); + test.equal(connection._version, LivedataTest.SUPPORTED_DDP_VERSIONS[0]); connection._stream.disconnect({_permanent: true}); onComplete(); } @@ -1359,7 +1359,7 @@ Tinytest.addAsync("livedata connection - version negotiation requires renegotiat Tinytest.addAsync("livedata connection - version negotiation error", function (test, onComplete) { - var connection = new _LivedataTest.Connection(getSelfConnectionUrl(), { + var connection = new LivedataTest.Connection(getSelfConnectionUrl(), { reloadWithOutstanding: true, supportedDDPVersions: ["garbled", "more garbled"], onConnectionFailure: function () { diff --git a/packages/livedata/livedata_server.js b/packages/livedata/livedata_server.js index bd9fe3d6b3..5c396c4a00 100644 --- a/packages/livedata/livedata_server.js +++ b/packages/livedata/livedata_server.js @@ -104,7 +104,7 @@ var SessionCollectionView = function (collectionName, sessionCallbacks) { self.callbacks = sessionCallbacks; }; -_LivedataTest.SessionCollectionView = SessionCollectionView; +LivedataTest.SessionCollectionView = SessionCollectionView; _.extend(SessionCollectionView.prototype, { @@ -1318,7 +1318,7 @@ var calculateVersion = function (clientSupportedVersions, return correctVersion; }; -_LivedataTest.calculateVersion = calculateVersion; +LivedataTest.calculateVersion = calculateVersion; // "blind" exceptions other than those that were deliberately thrown to signal diff --git a/packages/livedata/livedata_tests.js b/packages/livedata/livedata_tests.js index d727994571..7ea0f656e8 100644 --- a/packages/livedata/livedata_tests.js +++ b/packages/livedata/livedata_tests.js @@ -32,7 +32,7 @@ if (Meteor.isServer) { Tinytest.add("livedata - version negotiation", function (test) { var versionCheck = function (clientVersions, serverVersions, expected) { test.equal( - _LivedataTest.calculateVersion(clientVersions, serverVersions), + LivedataTest.calculateVersion(clientVersions, serverVersions), expected); }; @@ -504,7 +504,7 @@ if (Meteor.isClient) { testAsyncMulti("livedata - publisher errors", (function () { // Use a separate connection so that we can safely check to see if // conn._subscriptions is empty. - var conn = new _LivedataTest.Connection('/', + var conn = new LivedataTest.Connection('/', {reloadWithOutstanding: true}); var collName = Random.id(); var coll = new Meteor.Collection(collName, {connection: conn}); diff --git a/packages/livedata/package.js b/packages/livedata/package.js index 3a9eb2bf38..17cedb78b7 100644 --- a/packages/livedata/package.js +++ b/packages/livedata/package.js @@ -26,7 +26,7 @@ Package.on_use(function (api) { api.exportSymbol('DDP'); api.exportSymbol('DDPServer', 'server'); - api.exportSymbol('_LivedataTest', {testOnly: true}); + api.exportSymbol('LivedataTest', {testOnly: true}); // Transport api.use('reload', 'client'); diff --git a/packages/livedata/session_view_tests.js b/packages/livedata/session_view_tests.js index 6f590c3026..24c7ad2a8d 100644 --- a/packages/livedata/session_view_tests.js +++ b/packages/livedata/session_view_tests.js @@ -1,6 +1,6 @@ var newView = function(test) { var results = []; - var view = new _LivedataTest.SessionCollectionView('test', { + var view = new LivedataTest.SessionCollectionView('test', { added: function (collection, id, fields) { results.push({fun: 'added', id: id, fields: fields}); }, diff --git a/packages/livedata/stream_client_common.js b/packages/livedata/stream_client_common.js index 1ef4165a89..86de204b3b 100644 --- a/packages/livedata/stream_client_common.js +++ b/packages/livedata/stream_client_common.js @@ -1,4 +1,4 @@ -_LivedataTest = {}; +LivedataTest = {}; // XXX from Underscore.String (http://epeli.github.com/underscore.string/) var startsWith = function(str, starts) { @@ -70,7 +70,7 @@ toWebsocketUrl = function (url) { return ret; }; -_LivedataTest.toSockjsUrl = toSockjsUrl; +LivedataTest.toSockjsUrl = toSockjsUrl; _.extend(ClientStream.prototype, { diff --git a/packages/livedata/stream_tests.js b/packages/livedata/stream_tests.js index 25e9eeada6..0aef16d515 100644 --- a/packages/livedata/stream_tests.js +++ b/packages/livedata/stream_tests.js @@ -89,7 +89,7 @@ testAsyncMulti("stream - disconnect remains offline", [ Tinytest.add("stream - sockjs urls are computed correctly", function(test) { var testHasSockjsUrl = function(raw, expectedSockjsUrl) { - var actual = _LivedataTest.toSockjsUrl(raw); + var actual = LivedataTest.toSockjsUrl(raw); if (expectedSockjsUrl instanceof RegExp) test.isTrue(actual.match(expectedSockjsUrl), actual); else diff --git a/packages/mongo-livedata/mongo_driver.js b/packages/mongo-livedata/mongo_driver.js index c6d8a214f9..b230cfc125 100644 --- a/packages/mongo-livedata/mongo_driver.js +++ b/packages/mongo-livedata/mongo_driver.js @@ -7,7 +7,7 @@ * these outside of a fiber they will explode! */ -_MongoLivedataTest = {}; +MongoLivedataTest = {}; var path = Npm.require('path'); var MongoDB = Npm.require('mongodb'); @@ -993,7 +993,7 @@ _.extend(LiveResultsSet.prototype, { // - If you disconnect and reconnect from Mongo, it will essentially restart // the query, which will lead to duplicate results. This is pretty bad, // but if you include a field called 'ts' which is inserted as -// new _MongoLivedataTest.MongoTimestamp(0, 0) (which is initialized to the +// new MongoLivedataTest.MongoTimestamp(0, 0) (which is initialized to the // current Mongo-style timestamp), we'll be able to find the place to // restart properly. (This field is specifically understood by Mongo with an // optimization which allows it to find the right place to start without @@ -1083,4 +1083,4 @@ MongoConnection.prototype._observeChangesTailable = function ( // XXX We probably need to find a better way to expose this. Right now // it's only used by tests, but in fact you need it in normal // operation to interact with capped collections. -_MongoLivedataTest.MongoTimestamp = MongoDB.Timestamp; +MongoLivedataTest.MongoTimestamp = MongoDB.Timestamp; diff --git a/packages/mongo-livedata/mongo_livedata_tests.js b/packages/mongo-livedata/mongo_livedata_tests.js index 0f1e6a2bc1..d00547dc09 100644 --- a/packages/mongo-livedata/mongo_livedata_tests.js +++ b/packages/mongo-livedata/mongo_livedata_tests.js @@ -745,7 +745,7 @@ testAsyncMulti('mongo-livedata - document goes through a transform, ' + idGenera testAsyncMulti('mongo-livedata - document with binary data, ' + idGeneration, [ function (test, expect) { // XXX probably shouldn't use EJSON's private test symbols - var bin = _EJSONTest.base64Decode( + var bin = EJSONTest.base64Decode( "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyBy" + "ZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJv" + "bSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhl" + diff --git a/packages/mongo-livedata/observe_changes_tests.js b/packages/mongo-livedata/observe_changes_tests.js index c58bcafece..73ebab83b9 100644 --- a/packages/mongo-livedata/observe_changes_tests.js +++ b/packages/mongo-livedata/observe_changes_tests.js @@ -206,7 +206,7 @@ if (Meteor.isServer) { self.xs = []; self.expects = []; self.insert = function (fields) { - coll.insert(_.extend({ts: new _MongoLivedataTest.MongoTimestamp(0, 0)}, + coll.insert(_.extend({ts: new MongoLivedataTest.MongoTimestamp(0, 0)}, fields)); }; diff --git a/packages/mongo-livedata/package.js b/packages/mongo-livedata/package.js index e3704754be..3e70766b84 100644 --- a/packages/mongo-livedata/package.js +++ b/packages/mongo-livedata/package.js @@ -26,7 +26,7 @@ Package.on_use(function (api) { // Allow us to detect 'autopublish', and publish collections if it's loaded. api.use('autopublish', 'server', {weak: true}); - api.exportSymbol('_MongoLivedataTest', 'server', {testOnly: true}); + api.exportSymbol('MongoLivedataTest', 'server', {testOnly: true}); api.add_files('mongo_driver.js', 'server'); api.add_files('local_collection_driver.js', ['client', 'server']); diff --git a/packages/oauth/oauth_server.js b/packages/oauth/oauth_server.js index aa78475742..e61e152582 100644 --- a/packages/oauth/oauth_server.js +++ b/packages/oauth/oauth_server.js @@ -1,7 +1,7 @@ var Fiber = Npm.require('fibers'); Oauth = {}; -_OauthTest = {}; +OauthTest = {}; RoutePolicy.declare('/_oauth/', 'network'); @@ -43,7 +43,7 @@ Oauth.registerService = function (name, version, urls, handleOauthRequest) { }; // For test cleanup. -_OauthTest.unregisterService = function (name) { +OauthTest.unregisterService = function (name) { delete registeredServices[name]; }; @@ -129,7 +129,7 @@ middleware = function (req, res, next) { } }; -_OauthTest.middleware = middleware; +OauthTest.middleware = middleware; // Handle /_oauth/* paths and extract the service name // diff --git a/packages/oauth/package.js b/packages/oauth/package.js index 5c292869e5..a41aeb5dea 100644 --- a/packages/oauth/package.js +++ b/packages/oauth/package.js @@ -9,7 +9,7 @@ Package.on_use(function (api) { api.use(['underscore', 'service-configuration'], 'server'); api.exportSymbol('Oauth'); - api.exportSymbol('_OauthTest', 'server', {testOnly: true}); + api.exportSymbol('OauthTest', 'server', {testOnly: true}); api.add_files('oauth_client.js', 'client'); api.add_files('oauth_server.js', 'server'); diff --git a/packages/oauth1/oauth1_server.js b/packages/oauth1/oauth1_server.js index 2cd79e603e..2e2a530020 100644 --- a/packages/oauth1/oauth1_server.js +++ b/packages/oauth1/oauth1_server.js @@ -1,7 +1,7 @@ // A place to store request tokens pending verification var requestTokens = {}; -_OAuth1Test = {requestTokens: requestTokens}; +OAuth1Test = {requestTokens: requestTokens}; // connect middleware Oauth._requestHandlers['1'] = function (service, query, res) { diff --git a/packages/oauth1/oauth1_tests.js b/packages/oauth1/oauth1_tests.js index 41156af438..d7eb0e1979 100644 --- a/packages/oauth1/oauth1_tests.js +++ b/packages/oauth1/oauth1_tests.js @@ -40,7 +40,7 @@ Tinytest.add("oauth1 - loginResultForCredentialToken is stored", function (test) }); // simulate logging in using twitterfoo - _OAuth1Test.requestTokens[credentialToken] = twitterfooAccessToken; + OAuth1Test.requestTokens[credentialToken] = twitterfooAccessToken; var req = { method: "POST", @@ -50,7 +50,7 @@ Tinytest.add("oauth1 - loginResultForCredentialToken is stored", function (test) oauth_token: twitterfooAccessToken } }; - _OauthTest.middleware(req, new http.ServerResponse(req)); + OauthTest.middleware(req, new http.ServerResponse(req)); // Test that right data is placed on the loginResult map test.equal( @@ -67,7 +67,7 @@ Tinytest.add("oauth1 - loginResultForCredentialToken is stored", function (test) Oauth._loginResultForCredentialToken[credentialToken].options.option1, twitterOption1); } finally { - _OauthTest.unregisterService(serviceName); + OauthTest.unregisterService(serviceName); } }); diff --git a/packages/oauth1/package.js b/packages/oauth1/package.js index 0dd304b6b9..dcecd3825d 100644 --- a/packages/oauth1/package.js +++ b/packages/oauth1/package.js @@ -11,7 +11,7 @@ Package.on_use(function (api) { api.use('http', 'server'); api.exportSymbol('OAuth1Binding', 'server'); - api.exportSymbol('_OAuth1Test', 'server', {testOnly: true}); + api.exportSymbol('OAuth1Test', 'server', {testOnly: true}); api.add_files('oauth1_binding.js', 'server'); api.add_files('oauth1_server.js', 'server'); diff --git a/packages/oauth2/oauth2_tests.js b/packages/oauth2/oauth2_tests.js index b424e0430f..00cd88e7d3 100644 --- a/packages/oauth2/oauth2_tests.js +++ b/packages/oauth2/oauth2_tests.js @@ -20,7 +20,7 @@ Tinytest.add("oauth2 - loginResultForCredentialToken is stored", function (test) var req = {method: "POST", url: "/_oauth/" + serviceName + "?close", query: {state: credentialToken}}; - _OauthTest.middleware(req, new http.ServerResponse(req)); + OauthTest.middleware(req, new http.ServerResponse(req)); // Test that the login result for that user is prepared test.equal( @@ -31,6 +31,6 @@ Tinytest.add("oauth2 - loginResultForCredentialToken is stored", function (test) Oauth._loginResultForCredentialToken[credentialToken].options.option1, foobookOption1); } finally { - _OauthTest.unregisterService(serviceName); + OauthTest.unregisterService(serviceName); } }); diff --git a/packages/routepolicy/package.js b/packages/routepolicy/package.js index da08d2699c..dbe0b433ed 100644 --- a/packages/routepolicy/package.js +++ b/packages/routepolicy/package.js @@ -9,7 +9,7 @@ Package.on_use(function (api) { // Package.webapp and only after initial load. api.use('webapp', 'server', {unordered: true}); api.exportSymbol('RoutePolicy', 'server'); - api.exportSymbol('_RoutePolicyTest', 'server', {testOnly: true}); + api.exportSymbol('RoutePolicyTest', 'server', {testOnly: true}); api.add_files('routepolicy.js', 'server'); }); diff --git a/packages/routepolicy/routepolicy.js b/packages/routepolicy/routepolicy.js index f617a60b02..57e354e15f 100644 --- a/packages/routepolicy/routepolicy.js +++ b/packages/routepolicy/routepolicy.js @@ -24,9 +24,9 @@ // routes would break tinytest... so allow policy instances to be // constructed for testing. -_RoutePolicyTest = {}; +RoutePolicyTest = {}; -var RoutePolicyConstructor = _RoutePolicyTest.Constructor = function () { +var RoutePolicyConstructor = RoutePolicyTest.Constructor = function () { var self = this; self.urlPrefixTypes = {}; }; diff --git a/packages/routepolicy/routepolicy_tests.js b/packages/routepolicy/routepolicy_tests.js index a4fe220072..2c8ccc892e 100644 --- a/packages/routepolicy/routepolicy_tests.js +++ b/packages/routepolicy/routepolicy_tests.js @@ -1,5 +1,5 @@ Tinytest.add("routepolicy - declare", function (test) { - var policy = new _RoutePolicyTest.Constructor(); + var policy = new RoutePolicyTest.Constructor(); policy.declare('/sockjs/', 'network'); policy.declare('/bigphoto.jpg', 'static-online'); @@ -37,7 +37,7 @@ Tinytest.add("routepolicy - static conflicts", function (test) { "url": "/bigphoto.jpg" } ]; - var policy = new _RoutePolicyTest.Constructor(); + var policy = new RoutePolicyTest.Constructor(); test.equal( policy.checkForConflictWithStatic('/sockjs/', 'network', manifest), @@ -51,7 +51,7 @@ Tinytest.add("routepolicy - static conflicts", function (test) { }); Tinytest.add("routepolicy - checkUrlPrefix", function (test) { - var policy = new _RoutePolicyTest.Constructor(); + var policy = new RoutePolicyTest.Constructor(); policy.declare('/sockjs/', 'network'); test.equal( diff --git a/packages/spark/package.js b/packages/spark/package.js index 932bc455d7..eee2564830 100644 --- a/packages/spark/package.js +++ b/packages/spark/package.js @@ -9,7 +9,7 @@ Package.on_use(function (api) { 'client'); api.exportSymbol('Spark', 'client'); - api.exportSymbol('_SparkTest', 'client', {testOnly: true}); + api.exportSymbol('SparkTest', 'client', {testOnly: true}); api.add_files(['spark.js', 'patch.js', 'convenience.js', 'utils.js'], 'client'); diff --git a/packages/spark/patch.js b/packages/spark/patch.js index 7c4375dba1..7fcfbeb72f 100644 --- a/packages/spark/patch.js +++ b/packages/spark/patch.js @@ -571,4 +571,4 @@ Patcher._copyAttributes = function(tgt, src) { } }; -_SparkTest.Patcher = Patcher; +SparkTest.Patcher = Patcher; diff --git a/packages/spark/patch_tests.js b/packages/spark/patch_tests.js index c3bfd06487..a5360b4c5f 100644 --- a/packages/spark/patch_tests.js +++ b/packages/spark/patch_tests.js @@ -1,6 +1,6 @@ Tinytest.add("spark - patch - basic", function(test) { - var Patcher = _SparkTest.Patcher; + var Patcher = SparkTest.Patcher; var div = function(html) { var n = document.createElement("DIV"); @@ -144,7 +144,7 @@ Tinytest.add("spark - patch - copyAttributes", function(test) { if (! node) { node = n; } else { - _SparkTest.Patcher._copyAttributes(node, n); + SparkTest.Patcher._copyAttributes(node, n); } lastAttrs = {}; _.each(allAttrNames, function(v,k) { diff --git a/packages/spark/spark.js b/packages/spark/spark.js index bb616111aa..7c3cf27911 100644 --- a/packages/spark/spark.js +++ b/packages/spark/spark.js @@ -26,7 +26,7 @@ // (not hard to see what it is.) Spark = {}; -_SparkTest = {}; +SparkTest = {}; var currentRenderer = (function () { var current = null; @@ -44,7 +44,7 @@ var currentRenderer = (function () { })(); TAG = "_spark_" + Random.id(); -_SparkTest.TAG = TAG; +SparkTest.TAG = TAG; // We also export this as Spark._TAG due to a historical accident. I // don't know if anything uses it (possibly some of Chris Mather's @@ -67,7 +67,7 @@ var ANNOTATION_LIST_ITEM = "item"; // Use from tests to turn on extra UniversalEventListener sanity checks var checkIECompliance = false; -_SparkTest.setCheckIECompliance = function (value) { +SparkTest.setCheckIECompliance = function (value) { checkIECompliance = value; }; @@ -1244,7 +1244,7 @@ Spark.createLandmark = function (options, htmlFunc) { }); }; -_SparkTest.getEnclosingLandmark = function (node) { +SparkTest.getEnclosingLandmark = function (node) { var range = findRangeOfType(ANNOTATION_LANDMARK, node); return range ? range.landmark : null; }; diff --git a/packages/spark/spark_tests.js b/packages/spark/spark_tests.js index cb2d081fb6..cab0f7ea94 100644 --- a/packages/spark/spark_tests.js +++ b/packages/spark/spark_tests.js @@ -4,7 +4,7 @@ // XXX test variable wrapping (eg TR vs THEAD) inside each branch of Spark.list? -_SparkTest.setCheckIECompliance(true); +SparkTest.setCheckIECompliance(true); // Tests can use {preserve: idNameLabels} or renderWithPreservation // to cause any element with an id or name to be preserved. This effect @@ -74,7 +74,7 @@ Tinytest.add("spark - assembly", function (test) { test.equal(furtherCanon(f.html()), html); var actualGroups = []; - var tempRange = new LiveRange(_SparkTest.TAG, frag); + var tempRange = new LiveRange(SparkTest.TAG, frag); tempRange.visit(function (isStart, rng) { if (! isStart && rng.type === "data" /* Spark._ANNOTATION_DATA */) actualGroups.push(furtherCanon(canonicalizeHtml( @@ -3341,8 +3341,8 @@ Tinytest.add("spark - current landmark", function (test) { test.equal(callbacks, 1); Deps.flush(); test.equal(callbacks, 2); - test.equal(null, _SparkTest.getEnclosingLandmark(d.node())); - var enc = _SparkTest.getEnclosingLandmark(d.node().firstChild); + test.equal(null, SparkTest.getEnclosingLandmark(d.node())); + var enc = SparkTest.getEnclosingLandmark(d.node().firstChild); test.equal(enc.a, 9); test.equal(enc.b, 2); test.isFalse('c' in enc); @@ -3358,32 +3358,32 @@ Tinytest.add("spark - current landmark", function (test) { Deps.flush(); test.equal(callbacks, 4); - test.isTrue(_SparkTest.getEnclosingLandmark(findOuter()).outer); - test.isTrue(_SparkTest.getEnclosingLandmark(findInnerA()).innerA); - test.isTrue(_SparkTest.getEnclosingLandmark(findInnerB()).innerB); - test.equal(1, _SparkTest.getEnclosingLandmark(findOuter()).renderCount); - test.equal(1, _SparkTest.getEnclosingLandmark(findInnerA()).renderCount); - test.equal(1, _SparkTest.getEnclosingLandmark(findInnerB()).renderCount); + test.isTrue(SparkTest.getEnclosingLandmark(findOuter()).outer); + test.isTrue(SparkTest.getEnclosingLandmark(findInnerA()).innerA); + test.isTrue(SparkTest.getEnclosingLandmark(findInnerB()).innerB); + test.equal(1, SparkTest.getEnclosingLandmark(findOuter()).renderCount); + test.equal(1, SparkTest.getEnclosingLandmark(findInnerA()).renderCount); + test.equal(1, SparkTest.getEnclosingLandmark(findInnerB()).renderCount); R.set(4) Deps.flush(); test.equal(callbacks, 5); - test.equal(2, _SparkTest.getEnclosingLandmark(findOuter()).renderCount); - test.equal(2, _SparkTest.getEnclosingLandmark(findInnerA()).renderCount); + test.equal(2, SparkTest.getEnclosingLandmark(findOuter()).renderCount); + test.equal(2, SparkTest.getEnclosingLandmark(findInnerA()).renderCount); R.set(5) Deps.flush(); test.equal(callbacks, 6); - test.equal(3, _SparkTest.getEnclosingLandmark(findOuter()).renderCount); - test.equal(3, _SparkTest.getEnclosingLandmark(findInnerA()).renderCount); - test.equal(1, _SparkTest.getEnclosingLandmark(findInnerB()).renderCount); + test.equal(3, SparkTest.getEnclosingLandmark(findOuter()).renderCount); + test.equal(3, SparkTest.getEnclosingLandmark(findInnerA()).renderCount); + test.equal(1, SparkTest.getEnclosingLandmark(findInnerB()).renderCount); R.set(6) Deps.flush(); test.equal(callbacks, 7); - test.equal(4, _SparkTest.getEnclosingLandmark(findOuter()).renderCount); - test.equal(4, _SparkTest.getEnclosingLandmark(findInnerA()).renderCount); - test.equal(2, _SparkTest.getEnclosingLandmark(findInnerB()).renderCount); + test.equal(4, SparkTest.getEnclosingLandmark(findOuter()).renderCount); + test.equal(4, SparkTest.getEnclosingLandmark(findInnerA()).renderCount); + test.equal(2, SparkTest.getEnclosingLandmark(findInnerB()).renderCount); d.kill(); Deps.flush();