From 00f784cda8e128d2ee31a84e71b04941bdd48d79 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 16 Aug 2013 10:49:37 -0700 Subject: chore(ngdocs): disable lunr search during e2e tests lunr has been responsible for slowdown in our test suite by adding ~1sec per end-to-end test. (this is because it initializes the index when the app starts) since out test suite primarily tests the examples, it's reasonable do disable the search as a temporary meansure. the real fix is to use protractor and extract all of the examples into standalone apps which can be tested without bootstrapping the whole docs app. --- docs/src/templates/js/docs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/src/templates/js/docs.js') diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index 16042b3a..1deea88e 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -109,6 +109,8 @@ docsApp.controller.DocsNavigationCtrl = ['$scope', '$location', 'docsSearch', fu docsApp.serviceFactory.lunrSearch = function() { return function(properties) { + if (window.RUNNING_IN_NG_TEST_RUNNER) return null; + var engine = lunr(properties); return { store : function(values) { @@ -122,7 +124,10 @@ docsApp.serviceFactory.lunrSearch = function() { }; docsApp.serviceFactory.docsSearch = ['$rootScope','lunrSearch', 'NG_PAGES', - function($rootScope, lunrSearch, NG_PAGES) { + function($rootScope, lunrSearch, NG_PAGES) { + if (window.RUNNING_IN_NG_TEST_RUNNER) { + return null; + } var index = lunrSearch(function() { this.ref('id'); -- cgit v1.2.3