From 89333987d0a72ab8a0b556ad4fd8273a55fcceeb Mon Sep 17 00:00:00 2001 From: Magnus Dalin Date: Fri, 26 Jun 2015 09:54:18 +0200 Subject: [PATCH] Update config.js With the proposed change one could use the following to enable $qTick for all tests ``` beforeAll(function() { ngImprovedTesting.config.$setQTickDefault(true); }) ``` and disable it on old tests that don't support $qTick with: `ngImprovedTesting.config.$qTickDisable();` --- src/config.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/config.js b/src/config.js index fd5bd9b..09370be 100644 --- a/src/config.js +++ b/src/config.js @@ -6,14 +6,16 @@ var ngImprovedTestingConfigFlags = { }; var ngImprovedTestingConfig = { - $qTickEnable: function() { - afterEach(function() { - ngImprovedTestingConfigFlags.$qTick = false; + $setQTickDefault: function (isEnabledByDefault) { + beforeEach(function() { + ngImprovedTestingConfigFlags.$qTick = isEnabledByDefault; }); - - return function() { - ngImprovedTestingConfigFlags.$qTick = true; - }; + }, + $qTickEnable: function() { + ngImprovedTestingConfigFlags.$qTick = true; + }, + $qTickDisable: function() { + ngImprovedTestingConfigFlags.$qTick = false; } };