diff --git a/src/plugins/devMode/TestHarnessBuilder.js b/src/plugins/devMode/TestHarnessBuilder.js
index 2bab7384d556..01d6839792f6 100644
--- a/src/plugins/devMode/TestHarnessBuilder.js
+++ b/src/plugins/devMode/TestHarnessBuilder.js
@@ -52,9 +52,7 @@ module.exports = function (kbnServer) {
let deps = [];
let modules = {
angular: [],
- require: [
- 'angular-mocks'
- ]
+ require: []
};
if (testFiles) {
diff --git a/src/plugins/devMode/index.js b/src/plugins/devMode/index.js
index 01c503575a07..64c6e0ebf967 100644
--- a/src/plugins/devMode/index.js
+++ b/src/plugins/devMode/index.js
@@ -14,6 +14,7 @@ module.exports = function devModePlugin(kibana) {
let fromRoot = require('../../utils/fromRoot');
let pathContains = require('../../utils/pathContains');
+ let UiApp = require('../../server/ui/UiApp');
const SRC = fromRoot('src');
const UI = fromRoot('src/ui');
@@ -22,94 +23,96 @@ module.exports = function devModePlugin(kibana) {
return new kibana.Plugin({
init: function (server, options) {
- server.ext('onPreHandler', istanbul({ root: SRC, displayRoot: SRC, filter: kibanaSrcFilter }));
- server.ext('onPreHandler', istanbul({ root: UI, displayRoot: SRC, filter: kibanaSrcFilter }));
-
- server.setupViews(__dirname);
-
- let TestHarnessBuilder; // initialized in mixin below
- let currentBuilder = null;
-
- function getBuilder(path) {
- if (!currentBuilder || currentBuilder.path !== path) {
- currentBuilder = new TestHarnessBuilder(path);
- }
- return currentBuilder;
- }
-
- server.decorate('reply', 'renderTestHarness', function (path) {
- let reply = this;
-
- getBuilder(path).render().then(function (output) {
- if (!output || !output.bundle) {
- return reply(Boom.create(500, 'failed to build test bundle'));
- }
-
- return reply(output.bundle).type('application/javascript');
- });
- });
-
- server.decorate('reply', 'renderTestHarnessSourceMap', function (path) {
- let reply = this;
-
- getBuilder(path).render().then(function (output) {
- if (!output) {
- return reply(Boom.create(500, 'failed to build test bundle'));
- }
-
- if (!output.map) {
- return reply(Boom.notFound());
- }
-
- reply(output.map);
- });
- });
-
- server.redirectToSlash('/tests/plugins/{pluginId}');
-
- server.route({
- path: '/tests/plugins/{pluginId}/',
- method: 'GET',
- config: {
- pre: [
- 'kbnPluginById(params.pluginId)'
- ],
- handler: function (req, reply) {
- return reply.view('testHarness.jade', {
- bundlePath: `/testBundle/plugins/${req.params.pluginId}/`,
- });
- }
- }
- });
-
- server.route({
- path: '/testBundle/plugins/{pluginId}/',
- method: 'GET',
- config: {
- pre: [
- 'kbnPluginById(params.pluginId)'
- ],
- handler: function (req, reply) {
- return reply.renderTestHarness(req.pre.kbnPluginById.publicDir);
- }
- }
- });
-
- server.route({
- path: '/testBundle/plugins/{pluginId}/*.map',
- method: 'GET',
- config: {
- pre: [
- 'kbnPluginById(params.pluginId)'
- ],
- handler: function (req, reply) {
- return reply.renderTestHarnessSourceMap(req.pre.kbnPluginById.publicDir);
- }
- }
- });
-
return kibana.mixin(function (kbnServer) {
- TestHarnessBuilder = require('./TestHarnessBuilder')(kbnServer);
+
+ let TestHarnessBuilder = require('./TestHarnessBuilder')(kbnServer);
+
+ server.ext('onPreHandler', istanbul({ root: SRC, displayRoot: SRC, filter: kibanaSrcFilter }));
+ server.ext('onPreHandler', istanbul({ root: UI, displayRoot: SRC, filter: kibanaSrcFilter }));
+ server.setupViews(resolve(__dirname, 'views'));
+
+ server.redirectToSlash('/testUtils/plugins/{pluginId}');
+
+ let currentBuilder = null;
+ server.decorate('reply', 'renderTestPart', function (basePath, part, mimeType) {
+ let reply = this;
+
+ if (!currentBuilder || currentBuilder.path !== basePath) {
+ currentBuilder = new TestHarnessBuilder(basePath);
+ }
+
+ currentBuilder.render().then(function (output) {
+ if (!output || !output.bundle) {
+ return reply(Boom.create(500, 'failed to build test bundle'));
+ }
+
+ return reply(output[part]).type(mimeType);
+ });
+ });
+
+ server.route({
+ path: '/tests/plugins/{pluginId}/',
+ method: 'GET',
+ config: {
+ pre: [
+ 'kbnPluginById(params.pluginId)'
+ ],
+ handler: function (req, reply) {
+ let pluginId = req.params.pluginId;
+
+ let app = new UiApp(kbnServer.uiExports, {
+ id: `tests/plugins/${pluginId}`,
+ main: `/testBundle/plugins/${pluginId}/`,
+ autoload: {
+ angular: [],
+ require: []
+ }
+ });
+
+ return reply.renderApp(app, 'testHarness');
+ }
+ }
+ });
+
+ server.route({
+ path: '/testBundle/plugins/{pluginId}/',
+ method: 'GET',
+ config: {
+ pre: [
+ 'kbnPluginById(params.pluginId)'
+ ],
+ handler: function (req, reply) {
+ return reply.renderTestPart(req.pre.kbnPluginById.publicDir, 'bundle', 'application/javascript');
+ }
+ }
+ });
+
+ server.route({
+ path: '/testBundle/plugins/{pluginId}/*.map',
+ method: 'GET',
+ config: {
+ pre: [
+ 'kbnPluginById(params.pluginId)'
+ ],
+ handler: function (req, reply) {
+ return reply.renderTestPart(req.pre.kbnPluginById.publicDir, 'sourceMap', 'text/plain');
+ }
+ }
+ });
+
+ server.route({
+ path: '/testBundle/plugins/{pluginId}/css',
+ method: 'GET',
+ config: {
+ pre: [
+ 'kbnPluginById(params.pluginId)'
+ ],
+ handler: function (req, reply) {
+ return reply.renderTestPart(req.pre.kbnPluginById.publicDir, 'style', 'text/css');
+ }
+ }
+ });
+
});
},
@@ -119,6 +122,7 @@ module.exports = function devModePlugin(kibana) {
],
modules: {
+ ngMock$: 'plugins/devMode/ngMock',
sinon$: {
path: fromRoot('node_modules/sinon/pkg/sinon.js'),
parse: false
@@ -127,13 +131,19 @@ module.exports = function devModePlugin(kibana) {
testUtils: fromRoot('src/testUtils'),
mocha$: {
path: fromRoot('node_modules/mocha/mocha.js'),
- exports: 'window.mocha'
+ exports: 'window.mocha',
+ imports: 'mochaStyles'
},
+ mochaStyles$: fromRoot('node_modules/mocha/mocha.css'),
'angular-mocks': {
path: require.resolve('angular-mocks'),
imports: 'angular,mocha'
},
- }
+ },
+
+ loaders: [
+ { test: /\/__tests__\//, loader: 'imports?mocha' }
+ ]
}
});
};
diff --git a/src/plugins/devMode/public/bootstrap.js b/src/plugins/devMode/public/bootstrap.js
index d8e6cf2770f4..c52daaaa40d7 100644
--- a/src/plugins/devMode/public/bootstrap.js
+++ b/src/plugins/devMode/public/bootstrap.js
@@ -25,66 +25,63 @@ function setupCoverage(done) {
mocha.reporter(require('testUtils/istanbul_reporter/reporter'));
}
-exports.bootstrap = function (kibana, sinon) {
+exports.bootstrap = function () {
var $ = require('jquery');
var _ = require('lodash');
+ var sinon = require('sinon');
- $(function () {
- var _desc = window.describe;
- window.describe = _.wrap(_desc, unwindDescribeArrays);
- window.describe.only = _.wrap(_desc.only, unwindDescribeArrays);
+ var _desc = window.describe;
+ window.describe = _.wrap(_desc, unwindDescribeArrays);
+ window.describe.only = _.wrap(_desc.only, unwindDescribeArrays);
- if (COVERAGE) {
- setupCoverage();
- }
+ $('#mocha').html('');
- kibana.load(startMocha);
+ if (COVERAGE) {
+ setupCoverage();
+ }
- function startMocha() {
- var xhr = sinon.useFakeXMLHttpRequest();
- window.mochaRunner = mocha.run().on('end', function () {
- window.mochaResults = this.stats;
- window.mochaResults.details = getFailedTests(this);
- xhr.restore();
- });
+ require('ui/chrome').setupAngular();
- mocha.run();
- }
-
- function getFailedTests(runner) {
- var fails = [];
- var suiteStack = [];
- (function recurse(suite) {
- suiteStack.push(suite);
- (suite.tests || [])
- .filter(function (test) {
- return test.state && test.state !== 'passed' && test.state !== 'pending';
- })
- .forEach(function (test) {
- fails.push({
- title: suiteStack.concat(test).reduce(function (title, suite) {
- if (suite.title) {
- return (title ? title + ' ' : '') + suite.title;
- } else {
- return title;
- }
- }, ''),
- err: test.err ? (test.err.stack || test.err.message) : 'unknown error'
- });
- });
- (suite.suites || []).forEach(recurse);
- suiteStack.pop();
- }(runner.suite));
- return fails;
- }
-
- function unwindDescribeArrays(fn, name, body) {
- if (!body && name && name instanceof Array) {
- body = name[1];
- name = name[0];
- }
- return fn.call(this, name, body);
- }
+ var xhr = sinon.useFakeXMLHttpRequest();
+ window.mochaRunner = mocha.run().on('end', function () {
+ window.mochaResults = this.stats;
+ window.mochaResults.details = getFailedTests(this);
+ xhr.restore();
});
+
+ function getFailedTests(runner) {
+ var fails = [];
+ var suiteStack = [];
+ (function recurse(suite) {
+ suiteStack.push(suite);
+ (suite.tests || [])
+ .filter(function (test) {
+ return test.state && test.state !== 'passed' && test.state !== 'pending';
+ })
+ .forEach(function (test) {
+ fails.push({
+ title: suiteStack.concat(test).reduce(function (title, suite) {
+ if (suite.title) {
+ return (title ? title + ' ' : '') + suite.title;
+ } else {
+ return title;
+ }
+ }, ''),
+ err: test.err ? (test.err.stack || test.err.message) : 'unknown error'
+ });
+ });
+ (suite.suites || []).forEach(recurse);
+ suiteStack.pop();
+ }(runner.suite));
+ return fails;
+ }
+
+ function unwindDescribeArrays(fn, name, body) {
+ if (!body && _.isArray(name)) {
+ body = name[1];
+ name = name[0];
+ }
+ return fn.call(this, name, body);
+ }
};
diff --git a/src/plugins/devMode/public/ngMock.js b/src/plugins/devMode/public/ngMock.js
new file mode 100644
index 000000000000..ce51dd615d80
--- /dev/null
+++ b/src/plugins/devMode/public/ngMock.js
@@ -0,0 +1,2 @@
+require('angular-mocks');
+module.exports = require('angular').mock;
diff --git a/src/plugins/devMode/testHarness.jade b/src/plugins/devMode/testHarness.jade
deleted file mode 100644
index 9e1a2127cb7b..000000000000
--- a/src/plugins/devMode/testHarness.jade
+++ /dev/null
@@ -1,7 +0,0 @@
-doctype html
-html
- head
- title Kibana4 Tests
- script(async, src=bundlePath)
- body
- #mocha Loading tests, please wait.
diff --git a/src/plugins/devMode/views/testHarness.jade b/src/plugins/devMode/views/testHarness.jade
new file mode 100644
index 000000000000..a9f35d84dfe0
--- /dev/null
+++ b/src/plugins/devMode/views/testHarness.jade
@@ -0,0 +1,8 @@
+extends ../../../server/ui/views/chrome.jade
+
+block head
+ link(rel='stylesheet', href='#{app.main}css')
+
+block content
+ #mocha
+ script(async src=app.main)
diff --git a/src/plugins/kibana/public/discover/__tests__/directives/discover_field.js b/src/plugins/kibana/public/discover/__tests__/directives/discover_field.js
index b781897029fb..cc2ef95b1fdb 100644
--- a/src/plugins/kibana/public/discover/__tests__/directives/discover_field.js
+++ b/src/plugins/kibana/public/discover/__tests__/directives/discover_field.js
@@ -3,6 +3,7 @@ define(function (require) {
var $ = require('jquery');
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
// Load the kibana app dependencies.
@@ -12,7 +13,7 @@ define(function (require) {
var $parentScope, $scope, indexPattern;
var init = function ($elem, props) {
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
$parentScope = $rootScope;
_.assign($parentScope, props);
$compile($elem)($parentScope);
@@ -42,10 +43,10 @@ define(function (require) {
describe('discoverField', function () {
var $elem;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
$elem = angular.element('');
- inject(function (Private) {
+ ngMock.inject(function (Private) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
});
init($elem, {
diff --git a/src/plugins/kibana/public/discover/__tests__/directives/field_calculator.js b/src/plugins/kibana/public/discover/__tests__/directives/field_calculator.js
index e3541af85694..904851155670 100644
--- a/src/plugins/kibana/public/discover/__tests__/directives/field_calculator.js
+++ b/src/plugins/kibana/public/discover/__tests__/directives/field_calculator.js
@@ -1,5 +1,6 @@
define(function (require) {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var fieldCalculator = require('plugins/kibana/discover/components/field_chooser/lib/field_calculator');
var expect = require('expect.js');
@@ -9,9 +10,9 @@ define(function (require) {
var indexPattern;
describe('fieldCalculator', function () {
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
});
});
diff --git a/src/plugins/kibana/public/discover/__tests__/directives/field_chooser.js b/src/plugins/kibana/public/discover/__tests__/directives/field_chooser.js
index 10237c3da791..369f17f8fd29 100644
--- a/src/plugins/kibana/public/discover/__tests__/directives/field_chooser.js
+++ b/src/plugins/kibana/public/discover/__tests__/directives/field_chooser.js
@@ -1,5 +1,6 @@
define(function (require) {
var angular = require('angular');
+ var ngMock = require('ngMock');
var $ = require('jquery');
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
@@ -18,7 +19,7 @@ define(function (require) {
// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
var init = function ($elem, props) {
- inject(function ($rootScope, $compile, $timeout, _config_) {
+ ngMock.inject(function ($rootScope, $compile, $timeout, _config_) {
config = _config_;
$parentScope = $rootScope;
_.assign($parentScope, props);
@@ -52,9 +53,9 @@ define(function (require) {
''
);
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
hits = Private(require('fixtures/hits'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
indexPatternList = [ 'b', 'a', 'c' ];
diff --git a/src/plugins/kibana/public/discover/__tests__/hit_sort_fn.js b/src/plugins/kibana/public/discover/__tests__/hit_sort_fn.js
index 76ffd5ab489b..1cc222b074a3 100644
--- a/src/plugins/kibana/public/discover/__tests__/hit_sort_fn.js
+++ b/src/plugins/kibana/public/discover/__tests__/hit_sort_fn.js
@@ -1,5 +1,6 @@
define(function (require) {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
require('angular').module('hitSortFunctionTests', ['kibana']);
@@ -7,8 +8,8 @@ define(function (require) {
describe('hit sort function', function () {
var createHitSortFn;
- beforeEach(module('hitSortFunctionTests'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('hitSortFunctionTests'));
+ beforeEach(ngMock.inject(function (Private) {
createHitSortFn = Private(require('plugins/kibana/discover/_hit_sort_fn'));
}));
diff --git a/src/plugins/kibana/public/doc/__tests__/doc.js b/src/plugins/kibana/public/doc/__tests__/doc.js
index bd52a617b940..d932530df7b4 100644
--- a/src/plugins/kibana/public/doc/__tests__/doc.js
+++ b/src/plugins/kibana/public/doc/__tests__/doc.js
@@ -2,6 +2,7 @@ define(function (require) {
// Load the kibana app dependencies.
require('angular-route');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
require('plugins/kibana/doc/index');
@@ -9,10 +10,10 @@ define(function (require) {
var init = function (index, type, id) {
- module('kibana');
+ ngMock.module('kibana');
// Stub services
- module(function ($provide) {
+ ngMock.module(function ($provide) {
$provide.service('$route', function (Private) {
this.current = {
locals: {
@@ -65,7 +66,7 @@ define(function (require) {
});
// Create the scope
- inject(function ($rootScope, $controller, _timefilter_) {
+ ngMock.inject(function ($rootScope, $controller, _timefilter_) {
$scope = $rootScope.$new();
timefilter = _timefilter_;
diff --git a/src/plugins/kibana/public/visualize/editor/__tests__/agg.js b/src/plugins/kibana/public/visualize/editor/__tests__/agg.js
index 03616efd19fd..2ec929b553a4 100644
--- a/src/plugins/kibana/public/visualize/editor/__tests__/agg.js
+++ b/src/plugins/kibana/public/visualize/editor/__tests__/agg.js
@@ -3,6 +3,7 @@ define(function (require) {
var $ = require('jquery');
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('plugins/kibana/visualize/editor/agg');
@@ -42,7 +43,7 @@ define(function (require) {
};
}
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
$parentScope.agg = {
@@ -59,7 +60,7 @@ define(function (require) {
schema: makeConfig('radius')
}];
});
- beforeEach(inject(function ($rootScope, $compile) {
+ beforeEach(ngMock.inject(function ($rootScope, $compile) {
// share the scope
_.defaults($parentScope, $rootScope, Object.getPrototypeOf($rootScope));
diff --git a/src/plugins/markdown_vis/public/__tests__/markdown_vis_controller.js b/src/plugins/markdown_vis/public/__tests__/markdown_vis_controller.js
index 81e4c93c81e8..8b1502c90b8c 100644
--- a/src/plugins/markdown_vis/public/__tests__/markdown_vis_controller.js
+++ b/src/plugins/markdown_vis/public/__tests__/markdown_vis_controller.js
@@ -1,10 +1,11 @@
define(function (require) {
describe('markdown vis controller', function () {
var $scope, $el;
+ var ngMock = require('ngMock');
var expect = require('expect.js');
- beforeEach(module('kibana/markdown_vis'));
- beforeEach(inject(function ($rootScope, $controller) {
+ beforeEach(ngMock.module('kibana/markdown_vis'));
+ beforeEach(ngMock.inject(function ($rootScope, $controller) {
$scope = $rootScope.$new();
$controller('KbnMarkdownVisController', {$scope: $scope});
$scope.$digest();
diff --git a/src/plugins/metric_vis/public/__tests__/metric_vis_controller.js b/src/plugins/metric_vis/public/__tests__/metric_vis_controller.js
index eae9332c9a23..da4d864ab7b2 100644
--- a/src/plugins/metric_vis/public/__tests__/metric_vis_controller.js
+++ b/src/plugins/metric_vis/public/__tests__/metric_vis_controller.js
@@ -1,14 +1,15 @@
define(function (require) {
describe('metric vis', function () {
var $scope;
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var formatter = function (value) {
return value.toFixed(3);
};
- beforeEach(module('kibana/metric_vis'));
- beforeEach(inject(function ($rootScope, $controller) {
+ beforeEach(ngMock.module('kibana/metric_vis'));
+ beforeEach(ngMock.inject(function ($rootScope, $controller) {
$scope = $rootScope.$new();
$controller('KbnMetricVisController', {$scope: $scope});
$scope.$digest();
diff --git a/src/plugins/table_vis/public/__tests__/_table_vis.js b/src/plugins/table_vis/public/__tests__/_table_vis.js
index ef9f2231e4a7..1e74e7104f53 100644
--- a/src/plugins/table_vis/public/__tests__/_table_vis.js
+++ b/src/plugins/table_vis/public/__tests__/_table_vis.js
@@ -3,6 +3,7 @@ define(function (require) {
var $ = require('jquery');
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
var $rootScope;
@@ -14,8 +15,8 @@ define(function (require) {
var indexPattern;
var fixtures;
- beforeEach(module('kibana', 'kibana/table_vis'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana', 'kibana/table_vis'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
$rootScope = $injector.get('$rootScope');
$compile = $injector.get('$compile');
fixtures = require('fixtures/fake_hierarchical_data');
diff --git a/src/plugins/table_vis/public/__tests__/_table_vis_controller.js b/src/plugins/table_vis/public/__tests__/_table_vis_controller.js
index 93accc02da63..518056ab2f06 100644
--- a/src/plugins/table_vis/public/__tests__/_table_vis_controller.js
+++ b/src/plugins/table_vis/public/__tests__/_table_vis_controller.js
@@ -3,6 +3,7 @@ define(function (require) {
var $ = require('jquery');
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
var $rootScope;
@@ -14,8 +15,8 @@ define(function (require) {
var Vis;
var fixtures;
- beforeEach(module('kibana', 'kibana/table_vis'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana', 'kibana/table_vis'));
+ beforeEach(ngMock.inject(function ($injector) {
Private = $injector.get('Private');
$rootScope = $injector.get('$rootScope');
$compile = $injector.get('$compile');
diff --git a/src/server/optimize/BaseOptimizer.js b/src/server/optimize/BaseOptimizer.js
index ab76fe6aebbe..aca0c1e2a592 100644
--- a/src/server/optimize/BaseOptimizer.js
+++ b/src/server/optimize/BaseOptimizer.js
@@ -63,8 +63,7 @@ class BaseOptimizer extends EventEmitter {
{ test: /\.(html|tmpl)$/, loader: 'raw' },
{ test: /\.png$/, loader: 'url?limit=2048!file?name=[path][name].[ext]' },
{ test: /\.(woff|woff2|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file?name=[path][name].[ext]' },
- { test: /\/src\/(plugins|ui)\/.+\.js$/, loader: 'auto-preload-rjscommon-deps' },
- { test: /\/__tests__\//, loader: 'mocha' }
+ { test: /\/src\/(plugins|ui)\/.+\.js$/, loader: 'auto-preload-rjscommon-deps' }
].concat(this.modules.loaders),
noParse: this.modules.noParse,
},
diff --git a/src/server/optimize/LiveOptimizer.js b/src/server/optimize/LiveOptimizer.js
index 2882d2197be7..25261097944d 100644
--- a/src/server/optimize/LiveOptimizer.js
+++ b/src/server/optimize/LiveOptimizer.js
@@ -28,7 +28,8 @@ module.exports = class LiveOptimizer extends BaseOptimizer {
let self = this;
let fs = self.outFs;
let filename = join(self.compiler.outputPath, `${id}.bundle.js`);
- let mapFilename = filename + '.map';
+ let mapFilename = join(self.compiler.outputPath, `${id}.bundle.js.map`);
+ let styleFilename = join(self.compiler.outputPath, `${id}.style.css`);
self.active = (self.active || self.compile().finally(function () {
self.active = null;
@@ -43,7 +44,8 @@ module.exports = class LiveOptimizer extends BaseOptimizer {
try {
return {
bundle: fs.readFileSync(filename),
- map: self.sourceMaps ? fs.readFileSync(mapFilename) : false
+ sourceMap: self.sourceMaps ? fs.readFileSync(mapFilename) : false,
+ style: fs.readFileSync(styleFilename)
};
} catch (e) {
return null;
diff --git a/src/server/ui/helpers.js b/src/server/ui/helpers.js
index cd377ea25dea..ca6eb7f81c5d 100644
--- a/src/server/ui/helpers.js
+++ b/src/server/ui/helpers.js
@@ -1,7 +1,7 @@
module.exports = function (kbnServer, server, config) {
var _ = require('lodash');
- server.decorate('reply', 'renderApp', function (app) {
+ server.decorate('reply', 'renderApp', function (app, view) {
var optimizeStatus = kbnServer.status.get('optimize');
switch (optimizeStatus && optimizeStatus.state) {
@@ -22,7 +22,6 @@ module.exports = function (kbnServer, server, config) {
var payload = {
app: app,
- angularModules: app.getModules().angular,
appCount: kbnServer.uiExports.apps.length,
version: kbnServer.version,
buildSha: _.get(kbnServer, 'build.sha', '@@buildSha'),
@@ -32,7 +31,7 @@ module.exports = function (kbnServer, server, config) {
esShardTimeout: config.get('elasticsearch.shardTimeout')
};
- return this.view('bootstrap', {
+ return this.view(view || 'uiApp', {
app: app,
cacheBust: payload.cacheBust,
kibanaPayload: payload
diff --git a/src/server/ui/views/bootstrap.jade b/src/server/ui/views/chrome.jade
similarity index 77%
rename from src/server/ui/views/bootstrap.jade
rename to src/server/ui/views/chrome.jade
index 42f48aa53c6f..f93424eec0e2 100644
--- a/src/server/ui/views/bootstrap.jade
+++ b/src/server/ui/views/chrome.jade
@@ -8,7 +8,7 @@ html(lang='en')
meta(name='viewport', content='width=device-width')
link(rel='shortcut icon', href='/ui/images/elk.ico')
title Kibana
- link(rel='stylesheet', href='/bundles/#{app.id}.style.css')
+ block head
body(kbn-chrome)
script window.__KBN__ = !{j(kibanaPayload)};
- script(src='/bundles/#{app.id}.bundle.js')
+ block content
diff --git a/src/server/ui/views/uiApp.jade b/src/server/ui/views/uiApp.jade
new file mode 100644
index 000000000000..b5d74a0b642b
--- /dev/null
+++ b/src/server/ui/views/uiApp.jade
@@ -0,0 +1,7 @@
+extends ./chrome.jade
+
+block head
+ link(rel='stylesheet', href='/bundles/#{app.id}.style.css')
+
+block content
+ script(src='/bundles/#{app.id}.bundle.js')
diff --git a/src/ui/agg_response/geo_json/__tests__/geo_json.js b/src/ui/agg_response/geo_json/__tests__/geo_json.js
index 9dee3b651468..524db6116f27 100644
--- a/src/ui/agg_response/geo_json/__tests__/geo_json.js
+++ b/src/ui/agg_response/geo_json/__tests__/geo_json.js
@@ -1,6 +1,7 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('GeoJson Agg Response Converter', function () {
var vis;
@@ -9,8 +10,8 @@ define(function (require) {
var esResponse;
var aggs;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
var Vis = Private(require('ui/vis/vis'));
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_response/hierarchical/__tests__/build_hierarchical_data.js b/src/ui/agg_response/hierarchical/__tests__/build_hierarchical_data.js
index c14ca20cc771..fef81f1425f2 100644
--- a/src/ui/agg_response/hierarchical/__tests__/build_hierarchical_data.js
+++ b/src/ui/agg_response/hierarchical/__tests__/build_hierarchical_data.js
@@ -3,6 +3,7 @@ define(function (require) {
var fixtures = require('fixtures/fake_hierarchical_data');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Vis;
var Notifier;
@@ -12,8 +13,8 @@ define(function (require) {
describe('buildHierarchicalData()', function () {
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
// stub the error method before requiring vis causes Notifier#error to be bound
Notifier = $injector.get('Notifier');
sinon.stub(Notifier.prototype, 'error');
diff --git a/src/ui/agg_response/hierarchical/__tests__/create_raw_data.js b/src/ui/agg_response/hierarchical/__tests__/create_raw_data.js
index 355f40b9a24c..10e860f3a28c 100644
--- a/src/ui/agg_response/hierarchical/__tests__/create_raw_data.js
+++ b/src/ui/agg_response/hierarchical/__tests__/create_raw_data.js
@@ -4,6 +4,7 @@ define(function (require) {
var createRawData = require('ui/agg_response/hierarchical/_create_raw_data');
var arrayToLinkedList = require('ui/agg_response/hierarchical/_array_to_linked_list');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var AggConfigs;
var Vis;
@@ -13,9 +14,9 @@ define(function (require) {
describe('createRawData()', function () {
var vis, results;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfigs = Private(require('ui/vis/AggConfigs'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_response/hierarchical/__tests__/transform_aggregation.js b/src/ui/agg_response/hierarchical/__tests__/transform_aggregation.js
index 019dc5c91508..892d68e6a11c 100644
--- a/src/ui/agg_response/hierarchical/__tests__/transform_aggregation.js
+++ b/src/ui/agg_response/hierarchical/__tests__/transform_aggregation.js
@@ -3,11 +3,12 @@ define(function (require) {
describe('transformAggregation()', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var transform;
var fixture;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
transform = Private(require('ui/agg_response/hierarchical/_transform_aggregation'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_add_to_siri.js b/src/ui/agg_response/point_series/__tests__/_add_to_siri.js
index 3be017823829..d8f35487491f 100644
--- a/src/ui/agg_response/point_series/__tests__/_add_to_siri.js
+++ b/src/ui/agg_response/point_series/__tests__/_add_to_siri.js
@@ -1,10 +1,11 @@
define(function (require) {
return ['addToSiri', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var addToSiri;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
addToSiri = Private(require('ui/agg_response/point_series/_add_to_siri'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_fake_x_aspect.js b/src/ui/agg_response/point_series/__tests__/_fake_x_aspect.js
index 4c9e20bd9587..931757b6445b 100644
--- a/src/ui/agg_response/point_series/__tests__/_fake_x_aspect.js
+++ b/src/ui/agg_response/point_series/__tests__/_fake_x_aspect.js
@@ -7,9 +7,10 @@ define(function (require) {
var AggConfig;
var indexPattern;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
AggType = Private(require('ui/agg_types/_agg_type'));
diff --git a/src/ui/agg_response/point_series/__tests__/_get_aspects.js b/src/ui/agg_response/point_series/__tests__/_get_aspects.js
index c107b061dc96..c00812167a65 100644
--- a/src/ui/agg_response/point_series/__tests__/_get_aspects.js
+++ b/src/ui/agg_response/point_series/__tests__/_get_aspects.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var moment = require('moment');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Vis;
var Table;
@@ -10,8 +11,8 @@ define(function (require) {
var indexPattern;
var getAspects;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
Table = Private(require('ui/agg_response/point_series/_add_to_siri'));
AggConfig = Private(require('ui/vis/AggConfig'));
diff --git a/src/ui/agg_response/point_series/__tests__/_get_point.js b/src/ui/agg_response/point_series/__tests__/_get_point.js
index 4e65cd2f4dc3..aac43479041f 100644
--- a/src/ui/agg_response/point_series/__tests__/_get_point.js
+++ b/src/ui/agg_response/point_series/__tests__/_get_point.js
@@ -3,14 +3,15 @@ define(function (require) {
return ['getPoint', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var getPoint;
var truthFormatted = { fieldFormatter: _.constant(_.constant(true)) };
var identFormatted = { fieldFormatter: _.constant(_.identity) };
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
getPoint = Private(require('ui/agg_response/point_series/_get_point'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_get_series.js b/src/ui/agg_response/point_series/__tests__/_get_series.js
index 2f982077cc53..527dd5fae281 100644
--- a/src/ui/agg_response/point_series/__tests__/_get_series.js
+++ b/src/ui/agg_response/point_series/__tests__/_get_series.js
@@ -2,12 +2,13 @@ define(function (require) {
return ['getSeries', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var getSeries;
var agg = { fieldFormatter: _.constant(_.identity) };
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
getSeries = Private(require('ui/agg_response/point_series/_get_series'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_init_x_axis.js b/src/ui/agg_response/point_series/__tests__/_init_x_axis.js
index 436f8b61b554..b05ed34ee1dc 100644
--- a/src/ui/agg_response/point_series/__tests__/_init_x_axis.js
+++ b/src/ui/agg_response/point_series/__tests__/_init_x_axis.js
@@ -2,11 +2,12 @@ define(function (require) {
return ['initXAxis', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var initXAxis;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
initXAxis = Private(require('ui/agg_response/point_series/_init_x_axis'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_init_y_axis.js b/src/ui/agg_response/point_series/__tests__/_init_y_axis.js
index 6838b0987677..68fe861ceec3 100644
--- a/src/ui/agg_response/point_series/__tests__/_init_y_axis.js
+++ b/src/ui/agg_response/point_series/__tests__/_init_y_axis.js
@@ -2,11 +2,12 @@ define(function (require) {
return ['initYAxis', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var initYAxis;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
initYAxis = Private(require('ui/agg_response/point_series/_init_y_axis'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_main.js b/src/ui/agg_response/point_series/__tests__/_main.js
index a2dd58336625..4b47fba49070 100644
--- a/src/ui/agg_response/point_series/__tests__/_main.js
+++ b/src/ui/agg_response/point_series/__tests__/_main.js
@@ -6,14 +6,15 @@ define(function (require) {
var moment = require('moment');
var AggConfigResult = require('ui/vis/AggConfigResult');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var pointSeriesChartDataFromTable;
var indexPattern;
var Table;
var Vis;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
Table = Private(require('ui/agg_response/tabify/_table'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_response/point_series/__tests__/_ordered_date_axis.js b/src/ui/agg_response/point_series/__tests__/_ordered_date_axis.js
index d50505bb1c94..f7aeb453cce0 100644
--- a/src/ui/agg_response/point_series/__tests__/_ordered_date_axis.js
+++ b/src/ui/agg_response/point_series/__tests__/_ordered_date_axis.js
@@ -4,6 +4,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var baseArgs = {
vis: {
@@ -29,8 +30,8 @@ define(function (require) {
var orderedDateAxis;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
orderedDateAxis = Private(require('ui/agg_response/point_series/_ordered_date_axis'));
}));
diff --git a/src/ui/agg_response/point_series/__tests__/_tooltip_formatter.js b/src/ui/agg_response/point_series/__tests__/_tooltip_formatter.js
index ec6883535af8..2efc9bce736a 100644
--- a/src/ui/agg_response/point_series/__tests__/_tooltip_formatter.js
+++ b/src/ui/agg_response/point_series/__tests__/_tooltip_formatter.js
@@ -3,11 +3,12 @@ define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var tooltipFormatter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
tooltipFormatter = Private(require('ui/agg_response/point_series/_tooltip_formatter'));
}));
diff --git a/src/ui/agg_response/tabify/__tests__/_buckets.js b/src/ui/agg_response/tabify/__tests__/_buckets.js
index fa14b8bc085d..936de3d2bb5f 100644
--- a/src/ui/agg_response/tabify/__tests__/_buckets.js
+++ b/src/ui/agg_response/tabify/__tests__/_buckets.js
@@ -2,9 +2,10 @@ define(function (require) {
return ['Buckets wrapper', function () {
var Buckets;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
Buckets = Private(require('ui/agg_response/tabify/_buckets'));
}));
diff --git a/src/ui/agg_response/tabify/__tests__/_get_columns.js b/src/ui/agg_response/tabify/__tests__/_get_columns.js
index 07c1cf0b4689..c74a07267769 100644
--- a/src/ui/agg_response/tabify/__tests__/_get_columns.js
+++ b/src/ui/agg_response/tabify/__tests__/_get_columns.js
@@ -4,9 +4,10 @@ define(function (require) {
var Vis;
var indexPattern;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
getColumns = Private(require('ui/agg_response/tabify/_get_columns'));
Vis = Private(require('ui/vis/vis'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_response/tabify/__tests__/_integration.js b/src/ui/agg_response/tabify/__tests__/_integration.js
index f4e5a3c0413b..d54aee7c2abb 100644
--- a/src/ui/agg_response/tabify/__tests__/_integration.js
+++ b/src/ui/agg_response/tabify/__tests__/_integration.js
@@ -3,14 +3,15 @@ define(function (require) {
var _ = require('lodash');
var fixtures = require('fixtures/fake_hierarchical_data');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Vis;
var Buckets;
var indexPattern;
var tabifyAggResponse;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
Vis = Private(require('ui/vis/vis'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_response/tabify/__tests__/_response_writer.js b/src/ui/agg_response/tabify/__tests__/_response_writer.js
index 7ba1b3cdbf47..7a8f89e84449 100644
--- a/src/ui/agg_response/tabify/__tests__/_response_writer.js
+++ b/src/ui/agg_response/tabify/__tests__/_response_writer.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Vis;
var Table;
@@ -14,8 +15,8 @@ define(function (require) {
var ResponseWriter;
function defineSetup(stubGetColumns) {
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
Private = $injector.get('Private');
if (stubGetColumns) {
diff --git a/src/ui/agg_response/tabify/__tests__/_table.js b/src/ui/agg_response/tabify/__tests__/_table.js
index 1bbf3ca4d923..5ec23b8fddf4 100644
--- a/src/ui/agg_response/tabify/__tests__/_table.js
+++ b/src/ui/agg_response/tabify/__tests__/_table.js
@@ -2,11 +2,12 @@ define(function (require) {
return ['Table class', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Table;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
Table = Private(require('ui/agg_response/tabify/_table'));
}));
diff --git a/src/ui/agg_response/tabify/__tests__/_table_group.js b/src/ui/agg_response/tabify/__tests__/_table_group.js
index 61f1ff99c44d..9ec694b2069b 100644
--- a/src/ui/agg_response/tabify/__tests__/_table_group.js
+++ b/src/ui/agg_response/tabify/__tests__/_table_group.js
@@ -2,9 +2,10 @@ define(function (require) {
return ['Table Group class', function () {
var TableGroup;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
TableGroup = Private(require('ui/agg_response/tabify/_table_group'));
}));
diff --git a/src/ui/agg_table/__tests__/_group.js b/src/ui/agg_table/__tests__/_group.js
index 85499662261a..d49abbf5c986 100644
--- a/src/ui/agg_table/__tests__/_group.js
+++ b/src/ui/agg_table/__tests__/_group.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['AggTableGroup Directive', function () {
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var fixtures = require('fixtures/fake_hierarchical_data');
@@ -11,8 +12,8 @@ define(function (require) {
var Vis;
var indexPattern;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector, Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector, Private) {
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
Vis = Private(require('ui/vis/vis'));
diff --git a/src/ui/agg_table/__tests__/_table.js b/src/ui/agg_table/__tests__/_table.js
index fe5e044a56cd..a2761322ef2d 100644
--- a/src/ui/agg_table/__tests__/_table.js
+++ b/src/ui/agg_table/__tests__/_table.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['AggTable Directive', function () {
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var fixtures = require('fixtures/fake_hierarchical_data');
var sinon = require('auto-release-sinon/mocha');
@@ -12,8 +13,8 @@ define(function (require) {
var Vis;
var indexPattern;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector, Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector, Private) {
tabifyAggResponse = Private(require('ui/agg_response/tabify/tabify'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
Vis = Private(require('ui/vis/vis'));
diff --git a/src/ui/agg_types/__tests__/_agg_params.js b/src/ui/agg_types/__tests__/_agg_params.js
index 18b4e951acb8..90e0ace1b9f7 100644
--- a/src/ui/agg_types/__tests__/_agg_params.js
+++ b/src/ui/agg_types/__tests__/_agg_params.js
@@ -1,6 +1,7 @@
define(function (require) {
return ['AggParams class', function () {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var AggParams;
@@ -9,11 +10,11 @@ define(function (require) {
var OptionedAggParam;
var RegexAggParam;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
// stub out the param classes before we get the AggParams
- beforeEach(inject(require('specs/components/agg_types/utils/_stub_agg_params')));
+ beforeEach(ngMock.inject(require('specs/components/agg_types/utils/_stub_agg_params')));
// fetch out deps
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
AggParams = Private(require('ui/agg_types/_agg_params'));
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
FieldAggParam = Private(require('ui/agg_types/param_types/field'));
diff --git a/src/ui/agg_types/__tests__/_agg_type.js b/src/ui/agg_types/__tests__/_agg_type.js
index df60304358ef..0f4b6e356902 100644
--- a/src/ui/agg_types/__tests__/_agg_type.js
+++ b/src/ui/agg_types/__tests__/_agg_type.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['AggType Class', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
var AggType;
var AggParams;
@@ -12,8 +13,8 @@ define(function (require) {
require('ui/private');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
var AggParamsPM = require('ui/agg_types/_agg_params');
AggParams = sinon.spy(Private(AggParamsPM));
Private.stub(AggParamsPM, AggParams);
diff --git a/src/ui/agg_types/__tests__/_bucket_count_between.js b/src/ui/agg_types/__tests__/_bucket_count_between.js
index 7e5828e3f00c..536344ee6807 100644
--- a/src/ui/agg_types/__tests__/_bucket_count_between.js
+++ b/src/ui/agg_types/__tests__/_bucket_count_between.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['bucketCountBetween util', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var indexPattern;
var Vis;
var visTypes;
@@ -15,8 +16,8 @@ define(function (require) {
return ((n = +n) || 1 / n) < 0;
}
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
Vis = Private(require('ui/vis/vis'));
visTypes = Private(require('registry/vis_types'));
diff --git a/src/ui/agg_types/__tests__/buckets/_histogram.js b/src/ui/agg_types/__tests__/buckets/_histogram.js
index 2e117b6d55b2..66e89376eeb0 100644
--- a/src/ui/agg_types/__tests__/buckets/_histogram.js
+++ b/src/ui/agg_types/__tests__/buckets/_histogram.js
@@ -2,12 +2,13 @@ define(function (require) {
return ['Histogram Agg', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('ordered', function () {
var histogram;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
histogram = Private(require('ui/agg_types/index')).byName.histogram;
}));
@@ -24,8 +25,8 @@ define(function (require) {
describe('params', function () {
var paramWriter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
var AggParamWriter = Private(require('../aggParamWriter'));
paramWriter = new AggParamWriter({ aggType: 'histogram' });
}));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/date_histogram.js b/src/ui/agg_types/__tests__/buckets/create_filter/date_histogram.js
index 06b9f57cc746..98687e5d7c3d 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/date_histogram.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/date_histogram.js
@@ -5,6 +5,7 @@ define(function (require) {
var moment = require('moment');
var sinon = require('auto-release-sinon/mocha');
var aggResp = require('fixtures/agg_resp/date_histogram');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var vis;
@@ -18,8 +19,8 @@ define(function (require) {
var init;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
var Vis = Private(require('ui/vis/vis'));
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
var createFilter = Private(require('ui/agg_types/buckets/create_filter/date_histogram'));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/date_range.js b/src/ui/agg_types/__tests__/buckets/create_filter/date_range.js
index 394e603621b5..a4bc11eda744 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/date_range.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/date_range.js
@@ -1,6 +1,8 @@
define(function (require) {
var moment = require('moment');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('AggConfig Filters', function () {
describe('Date range', function () {
var AggConfig;
@@ -8,8 +10,8 @@ define(function (require) {
var Vis;
var createFilter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/filters.js b/src/ui/agg_types/__tests__/buckets/create_filter/filters.js
index 21223e75281b..79365f09ca57 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/filters.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/filters.js
@@ -1,6 +1,8 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('AggConfig Filters', function () {
describe('filters', function () {
var AggConfig;
@@ -8,8 +10,8 @@ define(function (require) {
var Vis;
var createFilter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/histogram.js b/src/ui/agg_types/__tests__/buckets/create_filter/histogram.js
index 90ed19ef4066..3e460838787f 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/histogram.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/histogram.js
@@ -1,6 +1,7 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('AggConfig Filters', function () {
describe('histogram', function () {
@@ -9,8 +10,8 @@ define(function (require) {
var Vis;
var createFilter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/ip_range.js b/src/ui/agg_types/__tests__/buckets/create_filter/ip_range.js
index 0bc7b306d390..c5225b0ec30e 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/ip_range.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/ip_range.js
@@ -1,14 +1,16 @@
define(function (require) {
describe('AggConfig Filters', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('IP range', function () {
var AggConfig;
var indexPattern;
var Vis;
var createFilter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/range.js b/src/ui/agg_types/__tests__/buckets/create_filter/range.js
index 73e56689e8d9..b56854b4cd81 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/range.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/range.js
@@ -1,14 +1,16 @@
define(function (require) {
describe('AggConfig Filters', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('range', function () {
var AggConfig;
var indexPattern;
var Vis;
var createFilter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/buckets/create_filter/terms.js b/src/ui/agg_types/__tests__/buckets/create_filter/terms.js
index c3de6c591bd3..669b77f6d4d6 100644
--- a/src/ui/agg_types/__tests__/buckets/create_filter/terms.js
+++ b/src/ui/agg_types/__tests__/buckets/create_filter/terms.js
@@ -1,14 +1,16 @@
define(function (require) {
describe('AggConfig Filters', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('terms', function () {
var AggConfig;
var indexPattern;
var Vis;
var createFilter;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/buckets/date_histogram/_editor.js b/src/ui/agg_types/__tests__/buckets/date_histogram/_editor.js
index f87d54ca9b56..65a63e1ea022 100644
--- a/src/ui/agg_types/__tests__/buckets/date_histogram/_editor.js
+++ b/src/ui/agg_types/__tests__/buckets/date_histogram/_editor.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['editor', function () {
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var indexPattern;
@@ -10,8 +11,8 @@ define(function (require) {
var render;
var $scope;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector, $compile) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector, $compile) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
var Vis = Private(require('ui/vis/vis'));
@@ -70,7 +71,7 @@ define(function (require) {
var field;
var interval;
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
field = _.sample(indexPattern.fields);
interval = _.sample(Private(require('ui/agg_types/buckets/_interval_options')));
params = render({ field: field, interval: interval });
diff --git a/src/ui/agg_types/__tests__/buckets/date_histogram/_params.js b/src/ui/agg_types/__tests__/buckets/date_histogram/_params.js
index 30abf92e7457..f695f761f08a 100644
--- a/src/ui/agg_types/__tests__/buckets/date_histogram/_params.js
+++ b/src/ui/agg_types/__tests__/buckets/date_histogram/_params.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var moment = require('moment');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var paramWriter;
var writeInterval;
@@ -12,8 +13,8 @@ define(function (require) {
var setTimeBounds;
var timeField;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
var AggParamWriter = Private(require('../../aggParamWriter'));
var indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
var timefilter = $injector.get('timefilter');
diff --git a/src/ui/agg_types/__tests__/controls/number_list.js b/src/ui/agg_types/__tests__/controls/number_list.js
index 867ee05a9ba8..a7ad9f350e85 100644
--- a/src/ui/agg_types/__tests__/controls/number_list.js
+++ b/src/ui/agg_types/__tests__/controls/number_list.js
@@ -4,6 +4,7 @@ define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
var simulateKeys = require('testUtils/simulateKeys');
+ var ngMock = require('ngMock');
require('ui/number_list/number_list');
@@ -18,8 +19,8 @@ define(function (require) {
});
}
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
var $compile = $injector.get('$compile');
var $rootScope = $injector.get('$rootScope');
diff --git a/src/ui/agg_types/__tests__/index.js b/src/ui/agg_types/__tests__/index.js
index 549e20f6304e..06f6e265a186 100644
--- a/src/ui/agg_types/__tests__/index.js
+++ b/src/ui/agg_types/__tests__/index.js
@@ -1,5 +1,6 @@
define(function (require) {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('AggTypesComponent', function () {
describe(require('specs/components/agg_types/_agg_type'));
@@ -11,8 +12,8 @@ define(function (require) {
var bucketAggs;
var BucketAggType;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
bucketAggs = Private(require('ui/agg_types/index')).byType.buckets;
BucketAggType = Private(require('ui/agg_types/buckets/_bucket_agg_type'));
}));
@@ -28,8 +29,8 @@ define(function (require) {
var metricAggs;
var MetricAggType;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
metricAggs = Private(require('ui/agg_types/index')).byType.metrics;
MetricAggType = Private(require('ui/agg_types/metrics/_metric_agg_type'));
}));
diff --git a/src/ui/agg_types/__tests__/param_types/_calculate_interval.js b/src/ui/agg_types/__tests__/param_types/_calculate_interval.js
index a812fe4e241c..d4db7025b5a2 100644
--- a/src/ui/agg_types/__tests__/param_types/_calculate_interval.js
+++ b/src/ui/agg_types/__tests__/param_types/_calculate_interval.js
@@ -1,6 +1,8 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('calculateInterval()', function () {
var AggConfig;
var indexPattern;
@@ -8,8 +10,8 @@ define(function (require) {
var createFilter;
var calculateInterval;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/agg_types/__tests__/param_types/_field.js b/src/ui/agg_types/__tests__/param_types/_field.js
index 4a899f1617d4..e488357ba3fe 100644
--- a/src/ui/agg_types/__tests__/param_types/_field.js
+++ b/src/ui/agg_types/__tests__/param_types/_field.js
@@ -2,13 +2,14 @@ define(function (require) {
return ['Field', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var BaseAggParam;
var FieldAggParam;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
// fetch out deps
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
FieldAggParam = Private(require('ui/agg_types/param_types/field'));
}));
diff --git a/src/ui/agg_types/__tests__/param_types/_optioned.js b/src/ui/agg_types/__tests__/param_types/_optioned.js
index a11ae4433679..62b116cc0698 100644
--- a/src/ui/agg_types/__tests__/param_types/_optioned.js
+++ b/src/ui/agg_types/__tests__/param_types/_optioned.js
@@ -2,13 +2,14 @@ define(function (require) {
return ['Optioned', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var BaseAggParam;
var OptionedAggParam;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
// fetch out deps
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
OptionedAggParam = Private(require('ui/agg_types/param_types/optioned'));
}));
diff --git a/src/ui/agg_types/__tests__/param_types/_raw_json.js b/src/ui/agg_types/__tests__/param_types/_raw_json.js
index ec36c94c76ca..101846df9074 100644
--- a/src/ui/agg_types/__tests__/param_types/_raw_json.js
+++ b/src/ui/agg_types/__tests__/param_types/_raw_json.js
@@ -1,6 +1,7 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
return ['JSON', function () {
@@ -21,10 +22,10 @@ define(function (require) {
aggParam = new JsonAggParam(_.defaults(config, defaults));
}
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
// fetch out deps
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
aggConfig = { params: {} };
output = { params: {} };
diff --git a/src/ui/agg_types/__tests__/param_types/_regex.js b/src/ui/agg_types/__tests__/param_types/_regex.js
index 790021993399..dde31db099fe 100644
--- a/src/ui/agg_types/__tests__/param_types/_regex.js
+++ b/src/ui/agg_types/__tests__/param_types/_regex.js
@@ -2,15 +2,16 @@ define(function (require) {
return ['Regex', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var BaseAggParam;
var RegexAggParam;
var Vis;
var indexPattern;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
// fetch out deps
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
RegexAggParam = Private(require('ui/agg_types/param_types/regex'));
Vis = Private(require('ui/vis/vis'));
diff --git a/src/ui/agg_types/__tests__/param_types/_string.js b/src/ui/agg_types/__tests__/param_types/_string.js
index f69c2f98ed51..3e388ada1728 100644
--- a/src/ui/agg_types/__tests__/param_types/_string.js
+++ b/src/ui/agg_types/__tests__/param_types/_string.js
@@ -1,6 +1,7 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
return ['String', function () {
var paramName = 'json_test';
@@ -20,10 +21,10 @@ define(function (require) {
aggParam = new StringAggParam(_.defaults(config, defaults));
}
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
// fetch our deps
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
BaseAggParam = Private(require('ui/agg_types/param_types/base'));
StringAggParam = Private(require('ui/agg_types/param_types/string'));
diff --git a/src/ui/agg_types/__tests__/utils/_stub_agg_params.js b/src/ui/agg_types/__tests__/utils/_stub_agg_params.js
index 5cf7667dce85..43a477478e81 100644
--- a/src/ui/agg_types/__tests__/utils/_stub_agg_params.js
+++ b/src/ui/agg_types/__tests__/utils/_stub_agg_params.js
@@ -12,16 +12,16 @@ define(function (require) {
/**
* stub all of the param classes, but ensure that they still inherit properly.
- * This method should be passed directly to inject();
+ * This method should be passed directly to ngMock.inject();
*
* ```js
* var stubParamClasses = require('specs/components/agg_types/utils/_stub_agg_params');
* describe('something', function () {
- * beforeEach(inject(stubParamClasses));
+ * beforeEach(ngMock.inject(stubParamClasses));
* })
* ```
*
- * @param {PrivateLoader} Private - The private module loader, inject by passing this function to inject()
+ * @param {PrivateLoader} Private - The private module loader, inject by passing this function to ngMock.inject()
* @return {undefined}
*/
return function stubParamClasses(Private) {
diff --git a/src/ui/bind/__tests__/bind.js b/src/ui/bind/__tests__/bind.js
index a407baae767e..75d13df7733f 100644
--- a/src/ui/bind/__tests__/bind.js
+++ b/src/ui/bind/__tests__/bind.js
@@ -2,12 +2,13 @@ define(function (require) {
describe('$scope.$bind', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var $rootScope;
var $scope;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
$rootScope = $injector.get('$rootScope');
$scope = $rootScope.$new();
}));
diff --git a/src/ui/chrome/chrome.js b/src/ui/chrome/chrome.js
index 556e8324e765..7de4e4ac6931 100644
--- a/src/ui/chrome/chrome.js
+++ b/src/ui/chrome/chrome.js
@@ -202,14 +202,8 @@ define(function (require) {
return tab ? tab.id : def;
};
- /**
- * Get the id of the active tab
- *
- * @param {*} def - the default value if there isn't any active tab
- * @return {*}
- */
- chrome.bootstrap = function (angularModules) {
- var kibana = modules.get('kibana', angularModules);
+ chrome.setupAngular = function (moduleDeps) {
+ var kibana = modules.get('kibana', moduleDeps);
kibana
.constant('kbnVersion', payload.version)
@@ -227,6 +221,16 @@ define(function (require) {
.constant('sessionId', Date.now());
modules.link(kibana);
+ };
+
+ /**
+ * Get the id of the active tab
+ *
+ * @param {*} def - the default value if there isn't any active tab
+ * @return {*}
+ */
+ chrome.bootstrap = function (angularModules) {
+ chrome.setupAngular(angularModules);
angular.bootstrap(document, ['kibana']);
$(document.body).children(':not(style-compile)').show();
};
diff --git a/src/ui/clipboard/__tests__/clipboard.js b/src/ui/clipboard/__tests__/clipboard.js
index 237055d4b016..f182a9fa86f8 100644
--- a/src/ui/clipboard/__tests__/clipboard.js
+++ b/src/ui/clipboard/__tests__/clipboard.js
@@ -4,6 +4,7 @@ define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
var $ = require('jquery');
+ var ngMock = require('ngMock');
require('ui/clipboard/clipboard');
@@ -17,9 +18,9 @@ define(function (require) {
function init() {
// load the application
- module('kibana');
+ ngMock.module('kibana');
- inject(function (_$rootScope_, _$compile_, _$interpolate_) {
+ ngMock.inject(function (_$rootScope_, _$compile_, _$interpolate_) {
$rootScope = _$rootScope_;
$compile = _$compile_;
$interpolate = _$interpolate_;
diff --git a/src/ui/config/__tests__/config.js b/src/ui/config/__tests__/config.js
index b4097ebfaf88..281e1d516014 100644
--- a/src/ui/config/__tests__/config.js
+++ b/src/ui/config/__tests__/config.js
@@ -4,9 +4,10 @@ define(function (require) {
var config;
var defaults;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector, Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector, Private) {
config = $injector.get('config');
$scope = $injector.get('$rootScope');
defaults = Private(require('ui/config/defaults'));
diff --git a/src/ui/courier/data_source/__tests__/decorate_query.js b/src/ui/courier/data_source/__tests__/decorate_query.js
index fec9ae189094..9e192290aa77 100644
--- a/src/ui/courier/data_source/__tests__/decorate_query.js
+++ b/src/ui/courier/data_source/__tests__/decorate_query.js
@@ -1,6 +1,8 @@
define(function (require) {
var moment = require('moment');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('Query decorator', function () {
var _ = require('lodash');
@@ -8,9 +10,9 @@ define(function (require) {
var indexPattern, getComputedFields, fn;
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- module('kibana', function ($provide) {
+ ngMock.module('kibana', function ($provide) {
// Super simple config stub
$provide.service('config', function () {
@@ -23,7 +25,7 @@ define(function (require) {
});
});
- beforeEach(inject(function (Private, $injector, _config_) {
+ beforeEach(ngMock.inject(function (Private, $injector, _config_) {
config = _config_;
fn = Private(require('ui/courier/data_source/_decorate_query'));
}));
diff --git a/src/ui/courier/data_source/__tests__/normalize_sort_request.js b/src/ui/courier/data_source/__tests__/normalize_sort_request.js
index 9dfc1b0c0dfe..b3e0f3f674c4 100644
--- a/src/ui/courier/data_source/__tests__/normalize_sort_request.js
+++ b/src/ui/courier/data_source/__tests__/normalize_sort_request.js
@@ -2,14 +2,15 @@ define(function (require) {
describe('SearchSource#normalizeSortRequest', function () {
require('ui/private');
require('angular').module('normalizeSortRequest', ['kibana']);
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var normalizeSortRequest;
var indexPattern;
var normalizedSort;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
normalizeSortRequest = Private(require('ui/courier/data_source/_normalize_sort_request'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/courier/fetch/__tests__/doc.js b/src/ui/courier/fetch/__tests__/doc.js
index 630ca146c32d..8eb5fe016383 100644
--- a/src/ui/courier/fetch/__tests__/doc.js
+++ b/src/ui/courier/fetch/__tests__/doc.js
@@ -2,6 +2,7 @@ define(function (require) {
describe('Courier DocFetchRequest class', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var storage;
var source;
@@ -10,8 +11,8 @@ define(function (require) {
var setVersion;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, Promise, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, Promise, $injector) {
var DocSource = Private(require('ui/courier/data_source/doc_source'));
var DocFetchRequest = Private(require('ui/courier/fetch/request/doc'));
diff --git a/src/ui/debounce/__tests__/debounce.js b/src/ui/debounce/__tests__/debounce.js
index 772a723125de..f4750808fcea 100644
--- a/src/ui/debounce/__tests__/debounce.js
+++ b/src/ui/debounce/__tests__/debounce.js
@@ -1,15 +1,16 @@
define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var debounce;
var $timeout;
var $timeoutSpy;
function init() {
- module('kibana');
+ ngMock.module('kibana');
- inject(function ($injector, _$timeout_) {
+ ngMock.inject(function ($injector, _$timeout_) {
$timeout = _$timeout_;
$timeoutSpy = sinon.spy($timeout);
diff --git a/src/ui/directives/__tests__/auto_select_if_only_one.js b/src/ui/directives/__tests__/auto_select_if_only_one.js
index 10cf8922a725..983bfdf6d4dd 100644
--- a/src/ui/directives/__tests__/auto_select_if_only_one.js
+++ b/src/ui/directives/__tests__/auto_select_if_only_one.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/directives/auto_select_if_only_one');
describe('Auto-select if only one directive', function () {
@@ -10,9 +11,9 @@ define(function (require) {
var oneOption = [{label: 'foo'}];
var multiOptions = [{label: 'foo'}, {label: 'bar'}];
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
$compile(html)($rootScope);
diff --git a/src/ui/directives/__tests__/confirm-click.js b/src/ui/directives/__tests__/confirm-click.js
index 95bbf0140702..12c60ff2817e 100644
--- a/src/ui/directives/__tests__/confirm-click.js
+++ b/src/ui/directives/__tests__/confirm-click.js
@@ -3,6 +3,7 @@ define(function (require) {
var $ = require('jquery');
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/directives/confirm_click');
@@ -15,10 +16,10 @@ define(function (require) {
var init = function (text) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
diff --git a/src/ui/directives/__tests__/css_truncate.js b/src/ui/directives/__tests__/css_truncate.js
index 6b81287ec09d..84ed2953844f 100644
--- a/src/ui/directives/__tests__/css_truncate.js
+++ b/src/ui/directives/__tests__/css_truncate.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('angular-route');
require('plugins/kibana/discover/index');
@@ -10,10 +11,10 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
diff --git a/src/ui/directives/__tests__/fixedScroll.js b/src/ui/directives/__tests__/fixedScroll.js
index 599b35f2ecf3..ee82653620f7 100644
--- a/src/ui/directives/__tests__/fixedScroll.js
+++ b/src/ui/directives/__tests__/fixedScroll.js
@@ -1,6 +1,7 @@
define(function (require) {
require('ui/fixedScroll');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('FixedScroll directive', function () {
var $ = require('jquery');
@@ -10,8 +11,8 @@ define(function (require) {
var compile;
var trash = [];
- beforeEach(module('kibana'));
- beforeEach(inject(function ($compile, $rootScope) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($compile, $rootScope) {
compile = function (ratioY, ratioX) {
if (ratioX == null) ratioX = ratioY;
diff --git a/src/ui/directives/__tests__/inequality.js b/src/ui/directives/__tests__/inequality.js
index 0e237bde61a6..a19bd1c9a10c 100644
--- a/src/ui/directives/__tests__/inequality.js
+++ b/src/ui/directives/__tests__/inequality.js
@@ -1,15 +1,16 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/directives/inequality');
describe('greater_than model validator directive', function () {
var $compile, $rootScope;
var html;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/directives/__tests__/input_focus.js b/src/ui/directives/__tests__/input_focus.js
index 3fdeddfc1f43..7bbf578121b5 100644
--- a/src/ui/directives/__tests__/input_focus.js
+++ b/src/ui/directives/__tests__/input_focus.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/directives/input_focus');
describe('Input focus directive', function () {
@@ -9,8 +10,8 @@ define(function (require) {
var $el, selectedEl, selectedText;
var inputValue = 'Input Text Value';
- beforeEach(module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_, _$timeout_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_, _$timeout_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
$timeout = _$timeout_;
diff --git a/src/ui/directives/__tests__/input_whole_number.js b/src/ui/directives/__tests__/input_whole_number.js
index cc3e678eafa0..03ed874afbed 100644
--- a/src/ui/directives/__tests__/input_whole_number.js
+++ b/src/ui/directives/__tests__/input_whole_number.js
@@ -1,15 +1,16 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/directives/input_whole_number');
describe('Whole number input directive', function () {
var $compile, $rootScope;
var html = '';
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/directives/__tests__/spinner.js b/src/ui/directives/__tests__/spinner.js
index a8f0f0d2d802..9f335a0c97c0 100644
--- a/src/ui/directives/__tests__/spinner.js
+++ b/src/ui/directives/__tests__/spinner.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -12,10 +13,10 @@ define(function (require) {
var init = function () {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
diff --git a/src/ui/directives/__tests__/timepicker.js b/src/ui/directives/__tests__/timepicker.js
index bfce313842ff..cead542c6ad0 100644
--- a/src/ui/directives/__tests__/timepicker.js
+++ b/src/ui/directives/__tests__/timepicker.js
@@ -5,6 +5,7 @@ define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var sinon = require('auto-release-sinon/mocha');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
@@ -22,13 +23,13 @@ define(function (require) {
var init = function () {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Stub out the clock so 'now' doesn't move
clock = sinon.useFakeTimers(moment(anchor).valueOf());
// Create the scope
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
@@ -88,7 +89,7 @@ define(function (require) {
var $courier;
beforeEach(function () {
init();
- inject(function (courier, $rootScope) {
+ ngMock.inject(function (courier, $rootScope) {
$courier = courier;
$rootScope.$apply();
});
diff --git a/src/ui/directives/__tests__/truncate.js b/src/ui/directives/__tests__/truncate.js
index 976e25866b0c..4da059e67780 100644
--- a/src/ui/directives/__tests__/truncate.js
+++ b/src/ui/directives/__tests__/truncate.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -12,10 +13,10 @@ define(function (require) {
var init = function (text) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
diff --git a/src/ui/directives/__tests__/typeahead.js b/src/ui/directives/__tests__/typeahead.js
index 1db05dc65b7a..83404abe29ae 100644
--- a/src/ui/directives/__tests__/typeahead.js
+++ b/src/ui/directives/__tests__/typeahead.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -25,9 +26,9 @@ define(function (require) {
var init = function () {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
- module('kibana/typeahead', function ($provide) {
+ ngMock.module('kibana/typeahead', function ($provide) {
$provide.factory('PersistedLog', function () {
function PersistedLogMock(name, options) {
this.name = name;
@@ -47,7 +48,7 @@ define(function (require) {
// Create the scope
- inject(function ($injector, $controller, $rootScope, $compile) {
+ ngMock.inject(function ($injector, $controller, $rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
diff --git a/src/ui/directives/__tests__/validate_cidr_mask.js b/src/ui/directives/__tests__/validate_cidr_mask.js
index 728ed77b3cee..9114a1c4de59 100644
--- a/src/ui/directives/__tests__/validate_cidr_mask.js
+++ b/src/ui/directives/__tests__/validate_cidr_mask.js
@@ -1,15 +1,17 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
require('ui/directives/validate_cidr_mask');
describe('Validate CIDR mask directive', function () {
var $compile, $rootScope;
var html = '';
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/directives/__tests__/validate_date_math.js b/src/ui/directives/__tests__/validate_date_math.js
index cc5d9d6bc72d..2aca644f60cf 100644
--- a/src/ui/directives/__tests__/validate_date_math.js
+++ b/src/ui/directives/__tests__/validate_date_math.js
@@ -1,15 +1,17 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
require('ui/directives/validate_date_math');
describe('Validate date math directive', function () {
var $compile, $rootScope;
var html = '';
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/directives/__tests__/validate_index_name.js b/src/ui/directives/__tests__/validate_index_name.js
index d1bae0b40368..b40b73aa6093 100644
--- a/src/ui/directives/__tests__/validate_index_name.js
+++ b/src/ui/directives/__tests__/validate_index_name.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('ui/directives/validate_index_name');
@@ -9,9 +10,9 @@ define(function (require) {
var $compile, $rootScope;
var html = '';
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/directives/__tests__/validate_ip.js b/src/ui/directives/__tests__/validate_ip.js
index 6d7d40c8ad01..9edf110896bc 100644
--- a/src/ui/directives/__tests__/validate_ip.js
+++ b/src/ui/directives/__tests__/validate_ip.js
@@ -1,15 +1,17 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
require('ui/directives/validate_ip');
describe('Validate IP directive', function () {
var $compile, $rootScope;
var html = '';
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (_$compile_, _$rootScope_) {
+ beforeEach(ngMock.inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/directives/__tests__/validate_json.js b/src/ui/directives/__tests__/validate_json.js
index 6e6b317c40c4..f6b27f417b4b 100644
--- a/src/ui/directives/__tests__/validate_json.js
+++ b/src/ui/directives/__tests__/validate_json.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('ui/directives/validate_json');
@@ -22,12 +23,12 @@ define(function (require) {
var init = function (type) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
type = type || 'input';
var elMarkup = markup[type];
// Create the scope
- inject(function ($injector, $rootScope, $compile) {
+ ngMock.inject(function ($injector, $rootScope, $compile) {
// Give us a scope
$parentScope = $rootScope;
$parentScope.mockModel = mockScope;
diff --git a/src/ui/directives/__tests__/validate_query.js b/src/ui/directives/__tests__/validate_query.js
index 84db20f72503..25edaf20f281 100644
--- a/src/ui/directives/__tests__/validate_query.js
+++ b/src/ui/directives/__tests__/validate_query.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('ui/validate_query/validate_query');
@@ -37,9 +38,9 @@ define(function (require) {
var init = function () {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
- module('kibana', function ($provide) {
+ ngMock.module('kibana', function ($provide) {
$provide.service('es', function () {
return { indices: { validateQuery: function () {} } };
});
@@ -57,7 +58,7 @@ define(function (require) {
});
// Create the scope
- inject(function ($injector, _$rootScope_, _$compile_, _$timeout_, _Promise_, _Private_, _config_) {
+ ngMock.inject(function ($injector, _$rootScope_, _$compile_, _$timeout_, _Promise_, _Private_, _config_) {
$timeout = _$timeout_;
$compile = _$compile_;
Promise = _Promise_;
diff --git a/src/ui/doc_table/__tests__/doc_table.js b/src/ui/doc_table/__tests__/doc_table.js
index 6c4baff5a1cd..19d0f6b7f85d 100644
--- a/src/ui/doc_table/__tests__/doc_table.js
+++ b/src/ui/doc_table/__tests__/doc_table.js
@@ -5,6 +5,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var searchResponse = require('fixtures/search_response');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('ui/private');
@@ -14,7 +15,7 @@ define(function (require) {
var $parentScope, $scope, $timeout, searchSource;
var init = function ($elem, props) {
- inject(function ($rootScope, $compile, _$timeout_) {
+ ngMock.inject(function ($rootScope, $compile, _$timeout_) {
$timeout = _$timeout_;
$parentScope = $rootScope;
_.assign($parentScope, props);
@@ -39,10 +40,10 @@ define(function (require) {
describe('docTable', function () {
var $elem;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
$elem = angular.element('');
- inject(function (Private) {
+ ngMock.inject(function (Private) {
searchSource = Private(require('fixtures/stubbed_search_source'));
});
init($elem, {
diff --git a/src/ui/doc_table/__tests__/lib/get_sort.js b/src/ui/doc_table/__tests__/lib/get_sort.js
index 5ccb341d01ff..a838e36171b7 100644
--- a/src/ui/doc_table/__tests__/lib/get_sort.js
+++ b/src/ui/doc_table/__tests__/lib/get_sort.js
@@ -2,12 +2,13 @@ define(function (require) {
var getSort = require('ui/doc_table/lib/get_sort');
var defaultSort = {time: 'desc'};
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var indexPattern;
describe('docTable', function () {
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_, Promise) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
}));
diff --git a/src/ui/doc_table/__tests__/lib/rows_headers.js b/src/ui/doc_table/__tests__/lib/rows_headers.js
index dca37ccfd66c..0aede8eaddc4 100644
--- a/src/ui/doc_table/__tests__/lib/rows_headers.js
+++ b/src/ui/doc_table/__tests__/lib/rows_headers.js
@@ -4,6 +4,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var getFakeRow = require('fixtures/fake_row');
describe('Doc Table', function () {
@@ -18,8 +19,8 @@ define(function (require) {
// Stub out a minimal mapping of 4 fields
var mapping;
- beforeEach(module('kibana', 'apps/discover'));
- beforeEach(inject(function (_config_, $rootScope, Private) {
+ beforeEach(ngMock.module('kibana', 'apps/discover'));
+ beforeEach(ngMock.inject(function (_config_, $rootScope, Private) {
config = _config_;
$parentScope = $rootScope;
$parentScope.indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
@@ -28,7 +29,7 @@ define(function (require) {
// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
var init = function ($elem, props) {
- inject(function ($compile) {
+ ngMock.inject(function ($compile) {
_.assign($parentScope, props);
$compile($elem)($parentScope);
$elem.scope().$digest();
@@ -316,7 +317,7 @@ define(function (require) {
var $root;
var $before;
- beforeEach(inject(function ($rootScope, $compile, Private) {
+ beforeEach(ngMock.inject(function ($rootScope, $compile, Private) {
$root = $rootScope;
$root.row = getFakeRow(0, mapping);
$root.columns = ['_source'];
diff --git a/src/ui/doc_title/__tests__/doc_title.js b/src/ui/doc_title/__tests__/doc_title.js
index c913efd46e75..ae369d0a3d19 100644
--- a/src/ui/doc_title/__tests__/doc_title.js
+++ b/src/ui/doc_title/__tests__/doc_title.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var initialDocTitle;
var MAIN_TITLE = 'Kibana 4';
var fakeApp = { name: 'fancy pants' };
@@ -18,12 +19,12 @@ define(function (require) {
document.title = initialDocTitle;
});
- beforeEach(module('kibana', function ($provide) {
+ beforeEach(ngMock.module('kibana', function ($provide) {
$provide.decorator('docTitle', decorateWithSpy('update'));
$provide.decorator('$rootScope', decorateWithSpy('$on'));
}));
- beforeEach(inject(function ($injector, Private) {
+ beforeEach(ngMock.inject(function ($injector, Private) {
if (_.random(0, 1)) {
docTitle = $injector.get('docTitle');
} else {
diff --git a/src/ui/doc_viewer/__tests__/doc_viewer.js b/src/ui/doc_viewer/__tests__/doc_viewer.js
index 2ef9388c326f..29976113c21e 100644
--- a/src/ui/doc_viewer/__tests__/doc_viewer.js
+++ b/src/ui/doc_viewer/__tests__/doc_viewer.js
@@ -4,6 +4,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var hit = {
'_index': 'logstash-2014.09.09',
'_type': 'apache',
@@ -27,7 +28,7 @@ define(function (require) {
var $parentScope, $scope, indexPattern, flattened;
var init = function ($elem, props) {
- inject(function ($rootScope, $compile) {
+ ngMock.inject(function ($rootScope, $compile) {
$parentScope = $rootScope;
_.assign($parentScope, props);
$compile($elem)($parentScope);
@@ -44,10 +45,10 @@ define(function (require) {
describe('docViewer', function () {
var $elem;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
$elem = angular.element('');
- inject(function (Private) {
+ ngMock.inject(function (Private) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
flattened = indexPattern.flattenHit(hit);
});
diff --git a/src/ui/factories/__tests__/base_object.js b/src/ui/factories/__tests__/base_object.js
index 0b6c8e479881..0ab673ab0f95 100644
--- a/src/ui/factories/__tests__/base_object.js
+++ b/src/ui/factories/__tests__/base_object.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/private');
@@ -10,9 +11,9 @@ define(function (require) {
var $rootScope;
var BaseObject;
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
BaseObject = require('utils/BaseObject');
});
diff --git a/src/ui/factories/__tests__/events.js b/src/ui/factories/__tests__/events.js
index 28cbe02c94fc..beaacd3ff770 100644
--- a/src/ui/factories/__tests__/events.js
+++ b/src/ui/factories/__tests__/events.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/private');
describe('Events', function () {
@@ -14,9 +15,9 @@ define(function (require) {
var Promise;
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- inject(function ($injector, Private) {
+ ngMock.inject(function ($injector, Private) {
$rootScope = $injector.get('$rootScope');
Notifier = $injector.get('Notifier');
Promise = $injector.get('Promise');
diff --git a/src/ui/fancy_forms/__tests__/fancy_forms.js b/src/ui/fancy_forms/__tests__/fancy_forms.js
index f69c77577913..e71d3594f4aa 100644
--- a/src/ui/fancy_forms/__tests__/fancy_forms.js
+++ b/src/ui/fancy_forms/__tests__/fancy_forms.js
@@ -1,5 +1,6 @@
define(function (require) {
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
describe('fancy forms', function () {
@@ -16,8 +17,8 @@ define(function (require) {
);
}
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
$rootScope = $injector.get('$rootScope');
$compile = $injector.get('$compile');
diff --git a/src/ui/field_editor/__tests__/field_editor.js b/src/ui/field_editor/__tests__/field_editor.js
index 62b800acd120..4a0efde58127 100644
--- a/src/ui/field_editor/__tests__/field_editor.js
+++ b/src/ui/field_editor/__tests__/field_editor.js
@@ -1,6 +1,7 @@
define(function (require) {
describe('FieldEditor directive', function () {
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var Field;
@@ -11,8 +12,8 @@ define(function (require) {
var $scope;
var $el;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($compile, $injector, Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($compile, $injector, Private) {
$rootScope = $injector.get('$rootScope');
Field = Private(require('ui/index_patterns/_field'));
StringFormat = Private(require('registry/field_formats')).getType('string');
diff --git a/src/ui/filter_bar/__tests__/_addFilters.js b/src/ui/filter_bar/__tests__/_addFilters.js
index dd33cd75f62c..fefb4101580c 100644
--- a/src/ui/filter_bar/__tests__/_addFilters.js
+++ b/src/ui/filter_bar/__tests__/_addFilters.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var MockState = require('fixtures/mock_state');
var storeNames = {
app: 'appState',
@@ -12,7 +13,7 @@ define(function (require) {
var queryFilter;
var $rootScope, appState, globalState;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
appState = new MockState({ filters: [] });
@@ -35,11 +36,11 @@ define(function (require) {
});
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -53,7 +54,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
});
diff --git a/src/ui/filter_bar/__tests__/_getFilters.js b/src/ui/filter_bar/__tests__/_getFilters.js
index 86590e78ec85..72b959592a91 100644
--- a/src/ui/filter_bar/__tests__/_getFilters.js
+++ b/src/ui/filter_bar/__tests__/_getFilters.js
@@ -1,6 +1,7 @@
define(function (require) {
return ['get filters', function () {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var MockState = require('fixtures/mock_state');
var storeNames = {
@@ -10,7 +11,7 @@ define(function (require) {
var queryFilter;
var $rootScope, appState, globalState;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
appState = new MockState({ filters: [] });
@@ -18,7 +19,7 @@ define(function (require) {
});
beforeEach(function () {
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -32,7 +33,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
diff --git a/src/ui/filter_bar/__tests__/_invertFilters.js b/src/ui/filter_bar/__tests__/_invertFilters.js
index d7bb60f079a4..564b6784d7e6 100644
--- a/src/ui/filter_bar/__tests__/_invertFilters.js
+++ b/src/ui/filter_bar/__tests__/_invertFilters.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var MockState = require('fixtures/mock_state');
var storeNames = {
app: 'appState',
@@ -12,7 +13,7 @@ define(function (require) {
var queryFilter;
var $rootScope, appState, globalState;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
appState = new MockState({ filters: [] });
@@ -35,11 +36,11 @@ define(function (require) {
});
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -53,7 +54,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
});
diff --git a/src/ui/filter_bar/__tests__/_pinFilters.js b/src/ui/filter_bar/__tests__/_pinFilters.js
index 240776426427..925949328747 100644
--- a/src/ui/filter_bar/__tests__/_pinFilters.js
+++ b/src/ui/filter_bar/__tests__/_pinFilters.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var MockState = require('fixtures/mock_state');
var storeNames = {
app: 'appState',
@@ -12,7 +13,7 @@ define(function (require) {
var queryFilter;
var $rootScope, appState, globalState;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
appState = new MockState({ filters: [] });
@@ -55,11 +56,11 @@ define(function (require) {
});
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -73,7 +74,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
});
diff --git a/src/ui/filter_bar/__tests__/_removeFilters.js b/src/ui/filter_bar/__tests__/_removeFilters.js
index 868a08e270af..f95bd1b73a27 100644
--- a/src/ui/filter_bar/__tests__/_removeFilters.js
+++ b/src/ui/filter_bar/__tests__/_removeFilters.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var MockState = require('fixtures/mock_state');
var storeNames = {
app: 'appState',
@@ -12,7 +13,7 @@ define(function (require) {
var queryFilter;
var $rootScope, appState, globalState;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
appState = new MockState({ filters: [] });
@@ -35,11 +36,11 @@ define(function (require) {
});
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -53,7 +54,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
});
diff --git a/src/ui/filter_bar/__tests__/_toggleFilters.js b/src/ui/filter_bar/__tests__/_toggleFilters.js
index cd2b4fb47c0f..00406e829f64 100644
--- a/src/ui/filter_bar/__tests__/_toggleFilters.js
+++ b/src/ui/filter_bar/__tests__/_toggleFilters.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['toggle filters', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
var MockState = require('fixtures/mock_state');
var storeNames = {
@@ -12,7 +13,7 @@ define(function (require) {
var queryFilter;
var $rootScope, appState, globalState;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
appState = new MockState({ filters: [] });
@@ -35,11 +36,11 @@ define(function (require) {
});
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -53,7 +54,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
});
diff --git a/src/ui/filter_bar/__tests__/changeTimeFilter.js b/src/ui/filter_bar/__tests__/changeTimeFilter.js
index 2233131bef59..1ae59e5b1985 100644
--- a/src/ui/filter_bar/__tests__/changeTimeFilter.js
+++ b/src/ui/filter_bar/__tests__/changeTimeFilter.js
@@ -1,14 +1,15 @@
define(function (require) {
var moment = require('moment');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
describe('Filter Bar Directive', function () {
describe('changeTimeFilter()', function () {
var changeTimeFilter, timefilter;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private, _timefilter_) {
+ beforeEach(ngMock.inject(function (Private, _timefilter_) {
changeTimeFilter = Private(require('ui/filter_bar/lib/changeTimeFilter'));
timefilter = _timefilter_;
}));
diff --git a/src/ui/filter_bar/__tests__/extractTimeFilter.js b/src/ui/filter_bar/__tests__/extractTimeFilter.js
index 80d6dc9b45de..60e6a61c9421 100644
--- a/src/ui/filter_bar/__tests__/extractTimeFilter.js
+++ b/src/ui/filter_bar/__tests__/extractTimeFilter.js
@@ -3,18 +3,19 @@ define(function (require) {
describe('extractTimeFilter()', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var extractTimeFilter,
$rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_, Promise) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
extractTimeFilter = Private(require('ui/filter_bar/lib/extractTimeFilter'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/filterOutTimeBasedFilter.js b/src/ui/filter_bar/__tests__/filterOutTimeBasedFilter.js
index ca2e270d33db..585cf5001ed0 100644
--- a/src/ui/filter_bar/__tests__/filterOutTimeBasedFilter.js
+++ b/src/ui/filter_bar/__tests__/filterOutTimeBasedFilter.js
@@ -3,19 +3,20 @@ define(function (require) {
describe('filterOutTimeBasedFilter()', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
var filterOutTimeBasedFilter,
$rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_, Promise) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
filterOutTimeBasedFilter = Private(require('ui/filter_bar/lib/filterOutTimeBasedFilter'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/filter_bar.js b/src/ui/filter_bar/__tests__/filter_bar.js
index 98484f544bf7..3d76860776ba 100644
--- a/src/ui/filter_bar/__tests__/filter_bar.js
+++ b/src/ui/filter_bar/__tests__/filter_bar.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
require('ui/filter_bar/filter_bar');
@@ -15,7 +16,7 @@ define(function (require) {
beforeEach(function () {
appState = new MockState({ filters: [] });
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -26,13 +27,13 @@ define(function (require) {
beforeEach(function () {
// load the application
- module('kibana');
+ ngMock.module('kibana');
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- inject(function (Private, $injector, _$rootScope_, _$compile_, _$timeout_) {
+ ngMock.inject(function (Private, $injector, _$rootScope_, _$compile_, _$timeout_) {
$rootScope = _$rootScope_;
$compile = _$compile_;
$timeout = _$timeout_;
diff --git a/src/ui/filter_bar/__tests__/generateMappingChain.js b/src/ui/filter_bar/__tests__/generateMappingChain.js
index 091ca883bb6c..1d5382080027 100644
--- a/src/ui/filter_bar/__tests__/generateMappingChain.js
+++ b/src/ui/filter_bar/__tests__/generateMappingChain.js
@@ -2,13 +2,14 @@ define(function (require) {
var generateMappingChain = require('ui/filter_bar/lib/generateMappingChain');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('Filter Bar Directive', function () {
describe('generateMappingChain()', function () {
var generateMappingChain, $rootScope, Promise;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_, _Promise_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, _Promise_) {
$rootScope = _$rootScope_;
Promise = _Promise_;
generateMappingChain = Private(require('ui/filter_bar/lib/generateMappingChain'));
diff --git a/src/ui/filter_bar/__tests__/mapAndFlattenFilters.js b/src/ui/filter_bar/__tests__/mapAndFlattenFilters.js
index f8eb4a8dfc1a..798d611c4342 100644
--- a/src/ui/filter_bar/__tests__/mapAndFlattenFilters.js
+++ b/src/ui/filter_bar/__tests__/mapAndFlattenFilters.js
@@ -2,18 +2,19 @@ define(function (require) {
describe('Filter Bar Directive', function () {
describe('mapAndFlattenFilters()', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
var mapAndFlattenFilters, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
mapAndFlattenFilters = Private(require('ui/filter_bar/lib/mapAndFlattenFilters'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/mapDefault.js b/src/ui/filter_bar/__tests__/mapDefault.js
index b91eadc35aac..b139521b0918 100644
--- a/src/ui/filter_bar/__tests__/mapDefault.js
+++ b/src/ui/filter_bar/__tests__/mapDefault.js
@@ -3,9 +3,10 @@ define(function (require) {
describe('mapDefault()', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapDefault, $rootScope;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
$rootScope = _$rootScope_;
mapDefault = Private(require('ui/filter_bar/lib/mapDefault'));
}));
diff --git a/src/ui/filter_bar/__tests__/mapExists.js b/src/ui/filter_bar/__tests__/mapExists.js
index aaf5e6a7cb71..aa16c9bab2fc 100644
--- a/src/ui/filter_bar/__tests__/mapExists.js
+++ b/src/ui/filter_bar/__tests__/mapExists.js
@@ -3,9 +3,10 @@ define(function (require) {
describe('mapExists()', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapExists, $rootScope;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
$rootScope = _$rootScope_;
mapExists = Private(require('ui/filter_bar/lib/mapExists'));
}));
diff --git a/src/ui/filter_bar/__tests__/mapFilter.js b/src/ui/filter_bar/__tests__/mapFilter.js
index 79bdc58e0264..ab6ca912f725 100644
--- a/src/ui/filter_bar/__tests__/mapFilter.js
+++ b/src/ui/filter_bar/__tests__/mapFilter.js
@@ -2,17 +2,18 @@ define(function (require) {
describe('Filter Bar Directive', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapFilter, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (_$rootScope_, Private) {
+ beforeEach(ngMock.inject(function (_$rootScope_, Private) {
mapFilter = Private(require('ui/filter_bar/lib/mapFilter'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/mapFlattenAndWrapFilters.js b/src/ui/filter_bar/__tests__/mapFlattenAndWrapFilters.js
index 2bb3f3e95e43..4f2e8e3044ac 100644
--- a/src/ui/filter_bar/__tests__/mapFlattenAndWrapFilters.js
+++ b/src/ui/filter_bar/__tests__/mapFlattenAndWrapFilters.js
@@ -4,16 +4,17 @@ define(function (require) {
describe('mapFlattenAndWrapFilters()', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapFlattenAndWrapFilters, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
mapFlattenAndWrapFilters = Private(require('ui/filter_bar/lib/mapFlattenAndWrapFilters'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/mapGeoBoundingBox.js b/src/ui/filter_bar/__tests__/mapGeoBoundingBox.js
index 8f1971ac7ef1..96f7d00c6d9e 100644
--- a/src/ui/filter_bar/__tests__/mapGeoBoundingBox.js
+++ b/src/ui/filter_bar/__tests__/mapGeoBoundingBox.js
@@ -3,16 +3,17 @@ define(function (require) {
describe('mapGeoBoundingBox()', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapGeoBoundingBox, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
mapGeoBoundingBox = Private(require('ui/filter_bar/lib/mapGeoBoundingBox'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/mapMissing.js b/src/ui/filter_bar/__tests__/mapMissing.js
index 7c4c79b0bcc7..48265d33d6f2 100644
--- a/src/ui/filter_bar/__tests__/mapMissing.js
+++ b/src/ui/filter_bar/__tests__/mapMissing.js
@@ -1,12 +1,13 @@
define(function (require) {
var mapMissing = require('ui/filter_bar/lib/mapMissing');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
describe('Filter Bar Directive', function () {
describe('mapMissing()', function () {
var mapMissing, $rootScope;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
$rootScope = _$rootScope_;
mapMissing = Private(require('ui/filter_bar/lib/mapMissing'));
}));
diff --git a/src/ui/filter_bar/__tests__/mapQueryString.js b/src/ui/filter_bar/__tests__/mapQueryString.js
index b164e92bb172..517853fd6d50 100644
--- a/src/ui/filter_bar/__tests__/mapQueryString.js
+++ b/src/ui/filter_bar/__tests__/mapQueryString.js
@@ -2,9 +2,10 @@ define(function (require) {
describe('Filter Bar Directive', function () {
describe('mapQueryString()', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapQueryString, $rootScope;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
$rootScope = _$rootScope_;
mapQueryString = Private(require('ui/filter_bar/lib/mapQueryString'));
}));
diff --git a/src/ui/filter_bar/__tests__/mapRange.js b/src/ui/filter_bar/__tests__/mapRange.js
index 31db346be059..7442daf7b3a2 100644
--- a/src/ui/filter_bar/__tests__/mapRange.js
+++ b/src/ui/filter_bar/__tests__/mapRange.js
@@ -3,16 +3,17 @@ define(function (require) {
describe('mapRange()', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapRange, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
mapRange = Private(require('ui/filter_bar/lib/mapRange'));
$rootScope = _$rootScope_;
}));
diff --git a/src/ui/filter_bar/__tests__/mapScript.js b/src/ui/filter_bar/__tests__/mapScript.js
index 3dd81faf1c51..60b8fcb4596c 100644
--- a/src/ui/filter_bar/__tests__/mapScript.js
+++ b/src/ui/filter_bar/__tests__/mapScript.js
@@ -3,16 +3,17 @@ define(function (require) {
describe('mapScript()', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapScript, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
$rootScope = _$rootScope_;
mapScript = Private(require('ui/filter_bar/lib/mapScript'));
}));
diff --git a/src/ui/filter_bar/__tests__/mapTerms.js b/src/ui/filter_bar/__tests__/mapTerms.js
index dff666f70c59..41acda448194 100644
--- a/src/ui/filter_bar/__tests__/mapTerms.js
+++ b/src/ui/filter_bar/__tests__/mapTerms.js
@@ -3,16 +3,17 @@ define(function (require) {
describe('mapTerms()', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var mapTerms, $rootScope;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
});
- beforeEach(inject(function (Private, _$rootScope_) {
+ beforeEach(ngMock.inject(function (Private, _$rootScope_) {
$rootScope = _$rootScope_;
mapTerms = Private(require('ui/filter_bar/lib/mapTerms'));
}));
diff --git a/src/ui/filter_bar/__tests__/push_filter.js b/src/ui/filter_bar/__tests__/push_filter.js
index 75a6e610201e..ff5841fba83e 100644
--- a/src/ui/filter_bar/__tests__/push_filter.js
+++ b/src/ui/filter_bar/__tests__/push_filter.js
@@ -2,11 +2,12 @@ define(function (require) {
describe('Filter Bar pushFilter()', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var pushFilterFn;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
pushFilterFn = Private(require('ui/filter_bar/push_filter'));
}));
@@ -24,7 +25,7 @@ define(function (require) {
var pushFilter;
var filter;
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.inject(function (Private, $injector) {
$state = {filters:[]};
pushFilter = pushFilterFn($state);
filter = {query: {query_string: {query: ''}}};
diff --git a/src/ui/filter_bar/__tests__/query_filter.js b/src/ui/filter_bar/__tests__/query_filter.js
index 8a09bd7c401a..f750b2192c6b 100644
--- a/src/ui/filter_bar/__tests__/query_filter.js
+++ b/src/ui/filter_bar/__tests__/query_filter.js
@@ -1,16 +1,17 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var queryFilter;
var EventEmitter;
var $rootScope;
describe('Query Filter', function () {
describe('Module', function () {
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
queryFilter = Private(require('ui/filter_bar/query_filter'));
EventEmitter = Private(require('ui/events'));
diff --git a/src/ui/filter_manager/__tests__/filter_manager.js b/src/ui/filter_manager/__tests__/filter_manager.js
index 707ce860d186..f5c5c5927311 100644
--- a/src/ui/filter_manager/__tests__/filter_manager.js
+++ b/src/ui/filter_manager/__tests__/filter_manager.js
@@ -3,6 +3,7 @@ define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var MockState = require('fixtures/mock_state');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var $rootScope;
var queryFilter;
var filterManager;
@@ -20,14 +21,14 @@ define(function (require) {
}
describe('Filter Manager', function () {
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
beforeEach(function () {
- module('kibana/courier', function ($provide) {
+ ngMock.module('kibana/courier', function ($provide) {
$provide.service('courier', require('fixtures/mock_courier'));
});
- module('kibana/global_state', function ($provide) {
+ ngMock.module('kibana/global_state', function ($provide) {
$provide.service('getAppState', function () {
return function () {
return appState;
@@ -37,7 +38,7 @@ define(function (require) {
});
beforeEach(function () {
- inject(function (_$rootScope_, Private) {
+ ngMock.inject(function (_$rootScope_, Private) {
$rootScope = _$rootScope_;
filterManager = Private(require('ui/filter_manager/filter_manager'));
appState = new MockState();
diff --git a/src/ui/filter_manager/__tests__/lib/phrase.js b/src/ui/filter_manager/__tests__/lib/phrase.js
index da4e86667706..621038735120 100644
--- a/src/ui/filter_manager/__tests__/lib/phrase.js
+++ b/src/ui/filter_manager/__tests__/lib/phrase.js
@@ -2,11 +2,12 @@ define(function (require) {
var fn = require('ui/filter_manager/lib/phrase');
var expect = require('expect.js');
var _ = require('lodash');
+ var ngMock = require('ngMock');
var indexPattern, expected;
describe('Filter Manager', function () {
describe('Phrase filter builder', function () {
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_, Promise) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
expected = _.cloneDeep(require('fixtures/filter_skeleton'));
}));
diff --git a/src/ui/filter_manager/__tests__/lib/query.js b/src/ui/filter_manager/__tests__/lib/query.js
index cae1f5b8b0d1..aacab0dcd098 100644
--- a/src/ui/filter_manager/__tests__/lib/query.js
+++ b/src/ui/filter_manager/__tests__/lib/query.js
@@ -2,11 +2,12 @@ define(function (require) {
var fn = require('ui/filter_manager/lib/query');
var expect = require('expect.js');
var _ = require('lodash');
+ var ngMock = require('ngMock');
var indexPattern, expected;
describe('Filter Manager', function () {
describe('Phrase filter builder', function () {
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_, Promise) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
expected = _.cloneDeep(require('fixtures/filter_skeleton'));
}));
diff --git a/src/ui/filter_manager/__tests__/lib/range.js b/src/ui/filter_manager/__tests__/lib/range.js
index 5fe9214613c8..39be660bdff3 100644
--- a/src/ui/filter_manager/__tests__/lib/range.js
+++ b/src/ui/filter_manager/__tests__/lib/range.js
@@ -2,11 +2,12 @@ define(function (require) {
var fn = require('ui/filter_manager/lib/range');
var expect = require('expect.js');
var _ = require('lodash');
+ var ngMock = require('ngMock');
var indexPattern, expected;
describe('Filter Manager', function () {
describe('Range filter builder', function () {
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, _$rootScope_, Promise) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, _$rootScope_, Promise) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
expected = _.cloneDeep(require('fixtures/filter_skeleton'));
}));
diff --git a/src/ui/filters/__tests__/comma_list_filter.js b/src/ui/filters/__tests__/comma_list_filter.js
index 50dad23d6833..8718e7464d83 100644
--- a/src/ui/filters/__tests__/comma_list_filter.js
+++ b/src/ui/filters/__tests__/comma_list_filter.js
@@ -1,13 +1,14 @@
define(function (require) {
require('ui/comma_list_filter');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('Comma-List filter', function () {
var commaList;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
commaList = $injector.get('commaListFilter');
}));
diff --git a/src/ui/filters/__tests__/field_type.js b/src/ui/filters/__tests__/field_type.js
index 0b0e779d471b..dff8a61c86fa 100644
--- a/src/ui/filters/__tests__/field_type.js
+++ b/src/ui/filters/__tests__/field_type.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
var _ = require('lodash');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -12,7 +13,7 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
types = [
{name: 's1', type: 'string'},
@@ -27,7 +28,7 @@ define(function (require) {
];
// Create the scope
- inject(function ($filter) {
+ ngMock.inject(function ($filter) {
filter = $filter('fieldType');
});
};
diff --git a/src/ui/filters/__tests__/label.js b/src/ui/filters/__tests__/label.js
index db33b12cdf93..c379ad7d444f 100644
--- a/src/ui/filters/__tests__/label.js
+++ b/src/ui/filters/__tests__/label.js
@@ -3,6 +3,7 @@ define(function (require) {
var expect = require('expect.js');
var _ = require('lodash');
var faker = require('faker');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -14,10 +15,10 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($filter) {
+ ngMock.inject(function ($filter) {
filter = $filter('label');
});
};
diff --git a/src/ui/filters/__tests__/moment.js b/src/ui/filters/__tests__/moment.js
index de77263c99fc..dcd16b23683c 100644
--- a/src/ui/filters/__tests__/moment.js
+++ b/src/ui/filters/__tests__/moment.js
@@ -3,6 +3,7 @@ define(function (require) {
var expect = require('expect.js');
var sinon = require('sinon');
var moment = require('moment');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -14,12 +15,12 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
clock = sinon.useFakeTimers(moment(anchor).valueOf());
// Create the scope
- inject(function ($filter, _config_) {
+ ngMock.inject(function ($filter, _config_) {
filter = $filter('moment');
config = _config_;
});
diff --git a/src/ui/filters/__tests__/rison.js b/src/ui/filters/__tests__/rison.js
index 26fbee11045d..8cd61f161a72 100644
--- a/src/ui/filters/__tests__/rison.js
+++ b/src/ui/filters/__tests__/rison.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -13,10 +14,10 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($filter) {
+ ngMock.inject(function ($filter) {
rison = $filter('rison');
risonDecode = $filter('risonDecode');
});
diff --git a/src/ui/filters/__tests__/short_dots.js b/src/ui/filters/__tests__/short_dots.js
index 1bfdde5b9557..f1cb39b5fe6f 100644
--- a/src/ui/filters/__tests__/short_dots.js
+++ b/src/ui/filters/__tests__/short_dots.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
var _ = require('lodash');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -12,10 +13,10 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($filter, _config_) {
+ ngMock.inject(function ($filter, _config_) {
config = _config_;
filter = $filter('shortDots');
});
diff --git a/src/ui/filters/__tests__/start_from.js b/src/ui/filters/__tests__/start_from.js
index ad5fc554fcef..ee6a9cd8de9c 100644
--- a/src/ui/filters/__tests__/start_from.js
+++ b/src/ui/filters/__tests__/start_from.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -10,10 +11,10 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($filter) {
+ ngMock.inject(function ($filter) {
filter = $filter('startFrom');
});
};
diff --git a/src/ui/filters/__tests__/uriescape.js b/src/ui/filters/__tests__/uriescape.js
index efbf51345ab3..6f52fa1b5003 100644
--- a/src/ui/filters/__tests__/uriescape.js
+++ b/src/ui/filters/__tests__/uriescape.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
var _ = require('lodash');
+ var ngMock = require('ngMock');
// Load the kibana app dependencies.
require('angular-route');
@@ -11,10 +12,10 @@ define(function (require) {
var init = function (expandable) {
// Load the application
- module('kibana');
+ ngMock.module('kibana');
// Create the scope
- inject(function ($filter) {
+ ngMock.inject(function ($filter) {
filter = $filter('uriescape');
});
};
diff --git a/src/ui/highlight/__tests__/highlight.js b/src/ui/highlight/__tests__/highlight.js
index 956b55e88d74..b3479e47794b 100644
--- a/src/ui/highlight/__tests__/highlight.js
+++ b/src/ui/highlight/__tests__/highlight.js
@@ -2,12 +2,13 @@ define(function (require) {
describe('Highlight', function () {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/highlight/highlight');
var filter, tags;
- beforeEach(module('kibana'));
- beforeEach(inject(function (highlightFilter, highlightTags) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (highlightFilter, highlightTags) {
filter = highlightFilter;
tags = highlightTags;
}));
diff --git a/src/ui/index_patterns/__tests__/_FieldFormat.js b/src/ui/index_patterns/__tests__/_FieldFormat.js
index fa83c9aa4264..0efb5ac506e2 100644
--- a/src/ui/index_patterns/__tests__/_FieldFormat.js
+++ b/src/ui/index_patterns/__tests__/_FieldFormat.js
@@ -2,12 +2,13 @@ define(function (require) {
return ['FieldFormat class', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var FieldFormat;
var TestFormat;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
FieldFormat = Private(require('ui/index_patterns/_field_format/FieldFormat'));
TestFormat = function (params) {
diff --git a/src/ui/index_patterns/__tests__/_cast_mapping_type.js b/src/ui/index_patterns/__tests__/_cast_mapping_type.js
index f1a1cfd1acfb..cf8fa9d0d2da 100644
--- a/src/ui/index_patterns/__tests__/_cast_mapping_type.js
+++ b/src/ui/index_patterns/__tests__/_cast_mapping_type.js
@@ -1,12 +1,13 @@
define(function (require) {
return ['type normalizer (castMappingType)', function () {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var fn;
var fields;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
fn = Private(require('ui/index_patterns/_cast_mapping_type'));
}));
diff --git a/src/ui/index_patterns/__tests__/_get_computed_fields.js b/src/ui/index_patterns/__tests__/_get_computed_fields.js
index 3880668d31ff..42142337eb52 100644
--- a/src/ui/index_patterns/__tests__/_get_computed_fields.js
+++ b/src/ui/index_patterns/__tests__/_get_computed_fields.js
@@ -2,10 +2,11 @@ define(function (require) {
return ['get computed fields', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var indexPattern, getComputedFields, fn;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
getComputedFields = require('ui/index_patterns/_get_computed_fields');
indexPattern.getComputedFields = getComputedFields.bind(indexPattern);
diff --git a/src/ui/index_patterns/__tests__/_index_pattern.js b/src/ui/index_patterns/__tests__/_index_pattern.js
index 0baa92e7dfb7..f68a867770f5 100644
--- a/src/ui/index_patterns/__tests__/_index_pattern.js
+++ b/src/ui/index_patterns/__tests__/_index_pattern.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['index pattern', function () {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var Promise = require('bluebird');
var errors = require('errors');
@@ -16,8 +17,8 @@ define(function (require) {
var indexPatternId = 'test-pattern';
var indexPattern;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector, _config_) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector, _config_) {
config = _config_;
mockLogstashFields = Private(require('fixtures/logstash_fields'));
docSourceResponse = Private(require('fixtures/stubbed_doc_source_response'));
diff --git a/src/ui/index_patterns/__tests__/_map_field.js b/src/ui/index_patterns/__tests__/_map_field.js
index 939417ebed10..a0a5c946bf4b 100644
--- a/src/ui/index_patterns/__tests__/_map_field.js
+++ b/src/ui/index_patterns/__tests__/_map_field.js
@@ -2,11 +2,12 @@ define(function (require) {
return ['field mapping normalizer (mapField)', function () {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var fn;
var fields;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector, config) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector, config) {
config.set('metaFields', ['_id', '_timestamp']);
fn = Private(require('ui/index_patterns/_map_field'));
fields = require('fixtures/field_mapping').test.mappings.testType;
diff --git a/src/ui/index_patterns/__tests__/flatten_hit.js b/src/ui/index_patterns/__tests__/flatten_hit.js
index de431f9ce660..54bd32648461 100644
--- a/src/ui/index_patterns/__tests__/flatten_hit.js
+++ b/src/ui/index_patterns/__tests__/flatten_hit.js
@@ -3,14 +3,15 @@ define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var flattenHit;
var config;
var hit;
var flat;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
var indexPattern = {
fields: {
byName: {
diff --git a/src/ui/index_patterns/__tests__/intervals.js b/src/ui/index_patterns/__tests__/intervals.js
index f48f3384673b..dccab7c46cf6 100644
--- a/src/ui/index_patterns/__tests__/intervals.js
+++ b/src/ui/index_patterns/__tests__/intervals.js
@@ -3,10 +3,11 @@ define(function (require) {
describe('Index Patterns', function () {
describe('interval.toIndexList()', function () {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var intervals;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
intervals = Private(require('ui/index_patterns/_intervals'));
}));
diff --git a/src/ui/listen/__tests__/listen.js b/src/ui/listen/__tests__/listen.js
index 5696ef69954a..5f731fe8f1b9 100644
--- a/src/ui/listen/__tests__/listen.js
+++ b/src/ui/listen/__tests__/listen.js
@@ -2,14 +2,15 @@ define(function (require) {
describe('listen component', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var $rootScope;
var Events;
require('ui/listen');
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector, Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector, Private) {
$rootScope = $injector.get('$rootScope');
Events = Private(require('ui/events'));
}));
diff --git a/src/ui/paginated_table/__tests__/index.js b/src/ui/paginated_table/__tests__/index.js
index 5cfbfa6c0ff3..fed067063f91 100644
--- a/src/ui/paginated_table/__tests__/index.js
+++ b/src/ui/paginated_table/__tests__/index.js
@@ -4,6 +4,7 @@ define(function (require) {
var $ = require('jquery');
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('paginated table', function () {
var $el;
@@ -57,9 +58,9 @@ define(function (require) {
};
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- inject(function (_$rootScope_, _$compile_, $filter) {
+ ngMock.inject(function (_$rootScope_, _$compile_, $filter) {
$rootScope = _$rootScope_;
$compile = _$compile_;
$orderBy = $filter('orderBy');
diff --git a/src/ui/persisted_log/__tests__/persisted_log.js b/src/ui/persisted_log/__tests__/persisted_log.js
index 844dafebc17c..c127352bb9b8 100644
--- a/src/ui/persisted_log/__tests__/persisted_log.js
+++ b/src/ui/persisted_log/__tests__/persisted_log.js
@@ -1,6 +1,7 @@
define(function (require) {
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var storage;
var config;
@@ -17,7 +18,7 @@ define(function (require) {
require('ui/persisted_log/persisted_log');
function init() {
- module('kibana/persisted_log', function ($provide) {
+ ngMock.module('kibana/persisted_log', function ($provide) {
// mock storage service
$provide.service('localStorage', function () {
this.get = sinon.stub();
@@ -27,7 +28,7 @@ define(function (require) {
});
});
- inject(function ($injector) {
+ ngMock.inject(function ($injector) {
storage = $injector.get('localStorage');
PersistedLog = $injector.get('PersistedLog');
});
diff --git a/src/ui/private/__tests__/private.js b/src/ui/private/__tests__/private.js
index 2ce2714b243c..412e04c4e2b9 100644
--- a/src/ui/private/__tests__/private.js
+++ b/src/ui/private/__tests__/private.js
@@ -3,9 +3,10 @@ define(function (require) {
var Private;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
Private = $injector.get('Private');
}));
diff --git a/src/ui/reflow_watcher/__tests__/reflow_watcher.js b/src/ui/reflow_watcher/__tests__/reflow_watcher.js
index aea9ea7b8551..7c43cc9ac85b 100644
--- a/src/ui/reflow_watcher/__tests__/reflow_watcher.js
+++ b/src/ui/reflow_watcher/__tests__/reflow_watcher.js
@@ -5,6 +5,7 @@ define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
var sinon = require('auto-release-sinon/mocha');
+ var ngMock = require('ngMock');
var $body = $(document.body);
var $window = $(window);
@@ -20,8 +21,8 @@ define(function (require) {
var $rootScope;
var $onStub;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
$rootScope = $injector.get('$rootScope');
EventEmitter = Private(require('ui/events'));
diff --git a/src/ui/registry/__tests__/index.js b/src/ui/registry/__tests__/index.js
index 65dff0b0de95..b59fd5bf88db 100644
--- a/src/ui/registry/__tests__/index.js
+++ b/src/ui/registry/__tests__/index.js
@@ -4,11 +4,12 @@ define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var registry = require('registry/_registry');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Private;
var IndexedArray;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
Private = $injector.get('Private');
}));
diff --git a/src/ui/state_management/__tests__/app_state.js b/src/ui/state_management/__tests__/app_state.js
index d4b0f6d791a6..40f5ae565989 100644
--- a/src/ui/state_management/__tests__/app_state.js
+++ b/src/ui/state_management/__tests__/app_state.js
@@ -1,15 +1,16 @@
define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/state_management/app_state');
describe('State Management', function () {
var $rootScope, AppState;
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- inject(function (_$rootScope_, _$location_, Private) {
+ ngMock.inject(function (_$rootScope_, _$location_, Private) {
$rootScope = _$rootScope_;
AppState = Private(require('ui/state_management/app_state'));
});
diff --git a/src/ui/state_management/__tests__/global_state.js b/src/ui/state_management/__tests__/global_state.js
index c1297f4c29de..e3167a200933 100644
--- a/src/ui/state_management/__tests__/global_state.js
+++ b/src/ui/state_management/__tests__/global_state.js
@@ -1,15 +1,16 @@
define(function (require) {
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/state_management/global_state');
describe('State Management', function () {
var $rootScope, $location, state;
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- inject(function (_$location_, globalState) {
+ ngMock.inject(function (_$location_, globalState) {
$location = _$location_;
state = globalState;
});
diff --git a/src/ui/state_management/__tests__/state.js b/src/ui/state_management/__tests__/state.js
index 5abf1c98cb5e..85467c5ee7cc 100644
--- a/src/ui/state_management/__tests__/state.js
+++ b/src/ui/state_management/__tests__/state.js
@@ -2,15 +2,16 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
require('ui/private');
describe('State Management', function () {
var $rootScope, $location, State, Events;
beforeEach(function () {
- module('kibana');
+ ngMock.module('kibana');
- inject(function (_$rootScope_, _$location_, Private) {
+ ngMock.inject(function (_$rootScope_, _$location_, Private) {
$location = _$location_;
$rootScope = _$rootScope_;
State = Private(require('ui/state_management/state'));
diff --git a/src/ui/storage/__tests__/storage.js b/src/ui/storage/__tests__/storage.js
index 7de6865bd669..1068edf171c6 100644
--- a/src/ui/storage/__tests__/storage.js
+++ b/src/ui/storage/__tests__/storage.js
@@ -1,6 +1,7 @@
define(function (require) {
var sinon = require('sinon');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var storage;
var $window;
@@ -9,7 +10,7 @@ define(function (require) {
require('ui/storage/storage');
function init() {
- module('kibana/storage', function ($provide) {
+ ngMock.module('kibana/storage', function ($provide) {
// mock $window.localStorage for storage
$provide.value('$window', {
localStorage: {
@@ -21,7 +22,7 @@ define(function (require) {
});
});
- inject(function ($injector) {
+ ngMock.inject(function ($injector) {
storage = $injector.get('localStorage');
$window = $injector.get('$window');
});
diff --git a/src/ui/stringify/__tests__/_conformance.js b/src/ui/stringify/__tests__/_conformance.js
index a745572dd618..fc91ea0d7649 100644
--- a/src/ui/stringify/__tests__/_conformance.js
+++ b/src/ui/stringify/__tests__/_conformance.js
@@ -1,6 +1,7 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var fieldFormats;
var FieldFormat;
@@ -19,8 +20,8 @@ define(function (require) {
return ['conformance', function () {
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private, $injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private, $injector) {
fieldFormats = Private(require('registry/field_formats'));
FieldFormat = Private(require('ui/index_patterns/_field_format/FieldFormat'));
config = $injector.get('config');
diff --git a/src/ui/stringify/__tests__/_ip.js b/src/ui/stringify/__tests__/_ip.js
index f2283e183f16..d3017fbfdd3a 100644
--- a/src/ui/stringify/__tests__/_ip.js
+++ b/src/ui/stringify/__tests__/_ip.js
@@ -2,9 +2,10 @@ define(function (require) {
return ['IP Address Format', function () {
var fieldFormats;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
fieldFormats = Private(require('registry/field_formats'));
}));
diff --git a/src/ui/stringify/__tests__/_source.js b/src/ui/stringify/__tests__/_source.js
index 6c2958f25c0e..e3401e3af02b 100644
--- a/src/ui/stringify/__tests__/_source.js
+++ b/src/ui/stringify/__tests__/_source.js
@@ -3,11 +3,12 @@ define(function (require) {
var $ = require('jquery');
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var fieldFormats;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
fieldFormats = Private(require('registry/field_formats'));
}));
@@ -17,7 +18,7 @@ define(function (require) {
var format;
var convertHtml;
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
hits = Private(require('fixtures/hits'));
format = fieldFormats.getInstance('_source');
diff --git a/src/ui/stringify/__tests__/_string.js b/src/ui/stringify/__tests__/_string.js
index 3282b5e12eef..cf581bad0b56 100644
--- a/src/ui/stringify/__tests__/_string.js
+++ b/src/ui/stringify/__tests__/_string.js
@@ -2,9 +2,10 @@ define(function (require) {
return ['String Format', function () {
var fieldFormats;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
fieldFormats = Private(require('registry/field_formats'));
}));
diff --git a/src/ui/stringify/__tests__/_url.js b/src/ui/stringify/__tests__/_url.js
index 64d4c68cc2bb..925afdfdb66c 100644
--- a/src/ui/stringify/__tests__/_url.js
+++ b/src/ui/stringify/__tests__/_url.js
@@ -2,11 +2,12 @@ define(function (require) {
return ['Url Format', function () {
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var fieldFormats;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
fieldFormats = Private(require('registry/field_formats'));
}));
diff --git a/src/ui/style_compile/__tests__/style_compile.js b/src/ui/style_compile/__tests__/style_compile.js
index e98919b38de1..caa2815e4d88 100644
--- a/src/ui/style_compile/__tests__/style_compile.js
+++ b/src/ui/style_compile/__tests__/style_compile.js
@@ -2,12 +2,13 @@ define(function (require) {
describe('styleCompile directive', function () {
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var config;
var $rootScope;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
config = $injector.get('config');
$rootScope = $injector.get('$rootScope');
}));
diff --git a/src/ui/timefilter/__tests__/diff_interval.js b/src/ui/timefilter/__tests__/diff_interval.js
index 6c596a45722d..757b7351a41e 100644
--- a/src/ui/timefilter/__tests__/diff_interval.js
+++ b/src/ui/timefilter/__tests__/diff_interval.js
@@ -1,13 +1,15 @@
define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('Timefilter service', function () {
describe('Refresh interval diff watcher', function () {
var fn, update, fetch, timefilter;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
update = sinon.spy();
fetch = sinon.spy();
timefilter = {
diff --git a/src/ui/timefilter/__tests__/diff_time.js b/src/ui/timefilter/__tests__/diff_time.js
index bfb4246d3264..b0936a0907e5 100644
--- a/src/ui/timefilter/__tests__/diff_time.js
+++ b/src/ui/timefilter/__tests__/diff_time.js
@@ -1,13 +1,15 @@
define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
+
describe('Timefilter service', function () {
describe('time diff watcher', function () {
var fn, update, fetch, timefilter;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
update = sinon.spy();
fetch = sinon.spy();
timefilter = {
diff --git a/src/ui/url/__tests__/url.js b/src/ui/url/__tests__/url.js
index 16c368f072a1..bc02eb8ef46d 100644
--- a/src/ui/url/__tests__/url.js
+++ b/src/ui/url/__tests__/url.js
@@ -1,6 +1,7 @@
define(function (require) {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var faker = require('faker');
var _ = require('lodash');
var MockState = require('fixtures/mock_state');
@@ -16,7 +17,7 @@ define(function (require) {
require('ui/url/url');
function init() {
- module('kibana/url', 'kibana', function ($provide) {
+ ngMock.module('kibana/url', 'kibana', function ($provide) {
$provide.service('$route', function () {
return {
reload: _.noop
@@ -40,7 +41,7 @@ define(function (require) {
});
});
- inject(function ($injector) {
+ ngMock.inject(function ($injector) {
$route = $injector.get('$route');
$location = $injector.get('$location');
$rootScope = $injector.get('$rootScope');
diff --git a/src/ui/utils/__tests__/diff_time_picker_vals.js b/src/ui/utils/__tests__/diff_time_picker_vals.js
index fd85a4c86f08..b3bc2d18b917 100644
--- a/src/ui/utils/__tests__/diff_time_picker_vals.js
+++ b/src/ui/utils/__tests__/diff_time_picker_vals.js
@@ -1,5 +1,6 @@
define(function (require) {
var moment = require('moment');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
require('angular').module('DiffTimePickerValues', ['kibana']);
@@ -7,8 +8,8 @@ define(function (require) {
describe('Diff Time Picker Values', function () {
var diffTimePickerValues;
- beforeEach(module('DiffTimePickerValues'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('DiffTimePickerValues'));
+ beforeEach(ngMock.inject(function (Private) {
diffTimePickerValues = Private(require('utils/diff_time_picker_vals'));
}));
diff --git a/src/ui/utils/__tests__/routes/_get_route_provider.js b/src/ui/utils/__tests__/routes/_get_route_provider.js
index 40ab840eeafc..af714b3af0eb 100644
--- a/src/ui/utils/__tests__/routes/_get_route_provider.js
+++ b/src/ui/utils/__tests__/routes/_get_route_provider.js
@@ -1,5 +1,6 @@
define(function (require) {
var angular = require('angular');
+ var ngMock = require('ngMock');
var sinon = require('auto-release-sinon/mocha');
/**
@@ -15,12 +16,12 @@ define(function (require) {
$routeProvider = _r;
}]);
- module('_Temp_Module_');
- inject(function () {});
+ ngMock.module('_Temp_Module_');
+ ngMock.inject(function () {});
sinon.stub($routeProvider, 'otherwise');
sinon.stub($routeProvider, 'when');
return $routeProvider;
};
-});
\ No newline at end of file
+});
diff --git a/src/ui/utils/__tests__/routes/_work_queue.js b/src/ui/utils/__tests__/routes/_work_queue.js
index 0819191b0258..ef4d87fe0da0 100644
--- a/src/ui/utils/__tests__/routes/_work_queue.js
+++ b/src/ui/utils/__tests__/routes/_work_queue.js
@@ -2,6 +2,7 @@ define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var WorkQueue = require('ui/routes/_work_queue');
var sinon = require('auto-release-sinon/mocha');
require('ui/promises');
@@ -12,8 +13,8 @@ define(function (require) {
var queue;
var Promise;
- beforeEach(module('UtilsRouteWorkQueueTests'));
- beforeEach(inject(function (_Promise_) {
+ beforeEach(ngMock.module('UtilsRouteWorkQueueTests'));
+ beforeEach(ngMock.inject(function (_Promise_) {
Promise = _Promise_;
}));
beforeEach(function () { queue = new WorkQueue(); });
diff --git a/src/ui/utils/__tests__/routes/_wrap_route_with_prep.js b/src/ui/utils/__tests__/routes/_wrap_route_with_prep.js
index 7e846d47d3c7..7a6e8a344706 100644
--- a/src/ui/utils/__tests__/routes/_wrap_route_with_prep.js
+++ b/src/ui/utils/__tests__/routes/_wrap_route_with_prep.js
@@ -1,6 +1,7 @@
define(function (require) {
var RouteManager = require('routes').RouteManager;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var getRouteProvider = require('./_get_route_provider');
var wrapRouteWithPrep = require('ui/routes/_wrap_route_with_prep');
@@ -27,7 +28,7 @@ define(function (require) {
var delayUserWork = opts.delayUserWork ? 50 : 0;
return function () {
- module('kibana', 'kibana/notify');
+ ngMock.module('kibana', 'kibana/notify');
var setupComplete = false;
var userWorkComplete = false;
var route;
@@ -35,7 +36,7 @@ define(function (require) {
var Promise;
var $injector;
- inject(function ($rootScope, _Private_, _Promise_, _$injector_) {
+ ngMock.inject(function ($rootScope, _Private_, _Promise_, _$injector_) {
Private = _Private_;
Promise = _Promise_;
$injector = _$injector_;
diff --git a/src/ui/vis/__tests__/_AggConfig.js b/src/ui/vis/__tests__/_AggConfig.js
index f1f547c33532..e6b4587c70ad 100644
--- a/src/ui/vis/__tests__/_AggConfig.js
+++ b/src/ui/vis/__tests__/_AggConfig.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['AggConfig', function () {
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Vis;
var AggType;
@@ -9,8 +10,8 @@ define(function (require) {
var indexPattern;
var fieldFormat;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggType = Private(require('ui/agg_types/_agg_type'));
AggConfig = Private(require('ui/vis/AggConfig'));
diff --git a/src/ui/vis/__tests__/_AggConfigResult.js b/src/ui/vis/__tests__/_AggConfigResult.js
index 892772a9cc0c..c2431731784b 100644
--- a/src/ui/vis/__tests__/_AggConfigResult.js
+++ b/src/ui/vis/__tests__/_AggConfigResult.js
@@ -3,13 +3,14 @@ define(function (require) {
var _ = require('lodash');
var AggConfigResult = require('ui/vis/AggConfigResult');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var AggConfig;
var indexPattern;
var Vis;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
AggConfig = Private(require('ui/vis/AggConfig'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
diff --git a/src/ui/vis/__tests__/_AggConfigs.js b/src/ui/vis/__tests__/_AggConfigs.js
index c145f9bdcad9..163f23270c11 100644
--- a/src/ui/vis/__tests__/_AggConfigs.js
+++ b/src/ui/vis/__tests__/_AggConfigs.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var sinon = require('auto-release-sinon/mocha');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var Vis;
var IndexedArray;
@@ -12,8 +13,8 @@ define(function (require) {
var indexPattern;
var Schemas;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
// replace the AggConfig module with a spy
var RealAggConfigPM = require('ui/vis/AggConfig');
AggConfig = Private(RealAggConfigPM);
diff --git a/src/ui/vis/__tests__/_Renderbot.js b/src/ui/vis/__tests__/_Renderbot.js
index 728d3351d27d..5f039a01ee47 100644
--- a/src/ui/vis/__tests__/_Renderbot.js
+++ b/src/ui/vis/__tests__/_Renderbot.js
@@ -2,11 +2,12 @@ define(function (require) {
return ['renderbot', function () {
var Renderbot;
var expect = require('expect.js');
+ var ngMock = require('ngMock');
function init() {
- module('kibana');
+ ngMock.module('kibana');
- inject(function (Private) {
+ ngMock.inject(function (Private) {
Renderbot = Private(require('ui/vis/Renderbot'));
});
}
diff --git a/src/ui/vis/__tests__/_Vis.js b/src/ui/vis/__tests__/_Vis.js
index 214098d353a7..4ffa50f47e9c 100644
--- a/src/ui/vis/__tests__/_Vis.js
+++ b/src/ui/vis/__tests__/_Vis.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['Vis Class', function () {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var indexPattern;
@@ -20,8 +21,8 @@ define(function (require) {
listeners: { click: _.noop }
};
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Vis = Private(require('ui/vis/vis'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
visTypes = Private(require('registry/vis_types'));
diff --git a/src/ui/vislib/__tests__/components/color.js b/src/ui/vislib/__tests__/components/color.js
index ba63bfecd6d6..8f6f7f468184 100644
--- a/src/ui/vislib/__tests__/components/color.js
+++ b/src/ui/vislib/__tests__/components/color.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
angular.module('ColorUtilService', ['kibana']);
angular.module('SeedColorUtilService', ['kibana']);
@@ -24,11 +25,11 @@ define(function (require) {
var color;
beforeEach(function () {
- module('ColorUtilService');
+ ngMock.module('ColorUtilService');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
seedColors = Private(require('ui/vislib/components/color/seed_colors'));
getColors = Private(require('ui/vislib/components/color/color'));
color = getColors(arr);
@@ -107,7 +108,7 @@ define(function (require) {
describe('Seed Colors', function () {
beforeEach(function () {
- module('SeedColorUtilService');
+ ngMock.module('SeedColorUtilService');
});
it('should return an array', function () {
@@ -130,11 +131,11 @@ define(function (require) {
var colorPalette;
beforeEach(function () {
- module('ColorPaletteUtilService');
+ ngMock.module('ColorPaletteUtilService');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
seedColors = Private(require('ui/vislib/components/color/seed_colors'));
createColorPalette = Private(require('ui/vislib/components/color/color_palette'));
colorPalette = createColorPalette(num1);
diff --git a/src/ui/vislib/__tests__/components/labels.js b/src/ui/vislib/__tests__/components/labels.js
index 7c6880334e7b..20cf0ac75e4a 100644
--- a/src/ui/vislib/__tests__/components/labels.js
+++ b/src/ui/vislib/__tests__/components/labels.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
angular.module('LabelUtilService', ['kibana']);
angular.module('GetArrayUtilService', ['kibana']);
@@ -112,11 +113,11 @@ define(function (require) {
describe('Labels (main)', function () {
beforeEach(function () {
- module('LabelUtilService');
+ ngMock.module('LabelUtilService');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
getLabels = Private(require('ui/vislib/components/labels/labels'));
seriesLabels = getLabels(seriesData);
rowsLabels = getLabels(rowsData);
@@ -181,11 +182,11 @@ define(function (require) {
var testRows;
beforeEach(function () {
- module('GetArrayUtilService');
+ ngMock.module('GetArrayUtilService');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
dataArray = Private(require('ui/vislib/components/labels/data_array'));
seriesLabels = dataArray(seriesData);
rowsLabels = dataArray(rowsData);
@@ -298,11 +299,11 @@ define(function (require) {
var testArr;
beforeEach(function () {
- module('UniqLabelUtilService');
+ ngMock.module('UniqLabelUtilService');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
uniqLabels = Private(require('ui/vislib/components/labels/uniq_labels'));
uniq = uniqLabels(arrObj, function (d) { return d; });
testArr = _.isArray(uniq);
@@ -376,11 +377,11 @@ define(function (require) {
var rowsArr;
beforeEach(function () {
- module('GetSeriesUtilService');
+ ngMock.module('GetSeriesUtilService');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
getSeries = Private(require('ui/vislib/components/labels/flatten_series'));
columnsLabels = getSeries(columnsData);
rowsLabels = getSeries(rowsData);
diff --git a/src/ui/vislib/__tests__/components/tooltip/_render.js b/src/ui/vislib/__tests__/components/tooltip/_render.js
index 5ec90768719c..ee2d6739d8f8 100644
--- a/src/ui/vislib/__tests__/components/tooltip/_render.js
+++ b/src/ui/vislib/__tests__/components/tooltip/_render.js
@@ -1,6 +1,7 @@
define(function (require) {
return function TooltipRenderingTestSuite() {
var expect = require('expect.js');
+ var ngMock = require('ngMock');
describe('render Method', function () {
var angular = require('angular');
@@ -14,11 +15,11 @@ define(function (require) {
var tooltips = [];
beforeEach(function () {
- module('TooltipFactory');
+ ngMock.module('TooltipFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))();
data = require('vislib_fixtures/mock_data/date_histogram/_series');
require('ui/vislib/styles/main.less');
diff --git a/src/ui/vislib/__tests__/components/zero_injection.js b/src/ui/vislib/__tests__/components/zero_injection.js
index 898eef1d06b4..c09429374f6f 100644
--- a/src/ui/vislib/__tests__/components/zero_injection.js
+++ b/src/ui/vislib/__tests__/components/zero_injection.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
angular.module('ZeroInjectionUtilService', ['kibana']);
angular.module('FlattenDataObjectUtilService', ['kibana']);
@@ -262,11 +263,11 @@ define(function (require) {
var sample3;
beforeEach(function () {
- module('ZeroInjectionUtilService');
+ ngMock.module('ZeroInjectionUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
injectZeros = Private(require('ui/vislib/components/zero_injection/inject_zeros'));
sample1 = injectZeros(seriesData);
sample2 = injectZeros(multiSeriesData);
@@ -373,11 +374,11 @@ define(function (require) {
var numberedResults;
beforeEach(function () {
- module('OrderedXKeysUtilService');
+ ngMock.module('OrderedXKeysUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
orderXValues = Private(require('ui/vislib/components/zero_injection/ordered_x_keys'));
results = orderXValues(multiSeriesData);
numberedResults = orderXValues(multiSeriesNumberedData);
@@ -437,11 +438,11 @@ define(function (require) {
var results;
beforeEach(function () {
- module('UniqueXValuesUtilService');
+ ngMock.module('UniqueXValuesUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
uniqueKeys = Private(require('ui/vislib/components/zero_injection/uniq_keys'));
results = uniqueKeys(multiSeriesData);
});
@@ -491,11 +492,11 @@ define(function (require) {
var results;
beforeEach(function () {
- module('ReplaceIndexUtilService');
+ ngMock.module('ReplaceIndexUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
flattenData = Private(require('ui/vislib/components/zero_injection/flatten_data'));
results = flattenData(multiSeriesData);
});
@@ -524,11 +525,11 @@ define(function (require) {
var results2;
beforeEach(function () {
- module('ZeroFilledArrayUtilService');
+ ngMock.module('ZeroFilledArrayUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
createZeroArray = Private(require('ui/vislib/components/zero_injection/zero_filled_array'));
results1 = createZeroArray(arr1);
results2 = createZeroArray(arr2);
@@ -611,11 +612,11 @@ define(function (require) {
var results;
beforeEach(function () {
- module('ZeroFillDataArrayUtilService');
+ ngMock.module('ZeroFillDataArrayUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
zeroFillArray = Private(require('ui/vislib/components/zero_injection/zero_fill_data_array'));
createZeroArray = Private(require('ui/vislib/components/zero_injection/zero_filled_array'));
arr1 = createZeroArray(xValueArr);
@@ -678,11 +679,11 @@ define(function (require) {
var results;
beforeEach(function () {
- module('ZeroInjectionUtilService');
+ ngMock.module('ZeroInjectionUtilService');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
injectZeros = Private(require('ui/vislib/components/zero_injection/inject_zeros'));
results = injectZeros(dateHistogramRows);
});
diff --git a/src/ui/vislib/__tests__/index.js b/src/ui/vislib/__tests__/index.js
index b2ce60615656..67643151b14b 100644
--- a/src/ui/vislib/__tests__/index.js
+++ b/src/ui/vislib/__tests__/index.js
@@ -1,6 +1,7 @@
define(function (require) {
var _ = require('lodash');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var angular = require('angular');
@@ -10,11 +11,11 @@ define(function (require) {
var visLib;
beforeEach(function () {
- module('kibana/vislib');
+ ngMock.module('kibana/vislib');
});
beforeEach(function () {
- inject(function (d3, vislib) {
+ ngMock.inject(function (d3, vislib) {
visLib = vislib;
});
});
diff --git a/src/ui/vislib/__tests__/lib/axis_title.js b/src/ui/vislib/__tests__/lib/axis_title.js
index cad863307c46..5de3f72d2020 100644
--- a/src/ui/vislib/__tests__/lib/axis_title.js
+++ b/src/ui/vislib/__tests__/lib/axis_title.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
angular.module('AxisTitleFactory', ['kibana']);
@@ -74,11 +75,11 @@ define(function (require) {
};
beforeEach(function () {
- module('AxisTitleFactory');
+ ngMock.module('AxisTitleFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
AxisTitle = Private(require('ui/vislib/lib/axis_title'));
Data = Private(require('ui/vislib/lib/data'));
diff --git a/src/ui/vislib/__tests__/lib/chart_title.js b/src/ui/vislib/__tests__/lib/chart_title.js
index 43c41e762222..25cdaefa927c 100644
--- a/src/ui/vislib/__tests__/lib/chart_title.js
+++ b/src/ui/vislib/__tests__/lib/chart_title.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
angular.module('ChartTitleFactory', ['kibana']);
@@ -72,11 +73,11 @@ define(function (require) {
};
beforeEach(function () {
- module('ChartTitleFactory');
+ ngMock.module('ChartTitleFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
ChartTitle = Private(require('ui/vislib/lib/chart_title'));
Data = Private(require('ui/vislib/lib/data'));
diff --git a/src/ui/vislib/__tests__/lib/data.js b/src/ui/vislib/__tests__/lib/data.js
index 6bdbfdc2a321..b858be36c813 100644
--- a/src/ui/vislib/__tests__/lib/data.js
+++ b/src/ui/vislib/__tests__/lib/data.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var Data;
@@ -105,9 +106,9 @@ define(function (require) {
describe('Vislib Data Class Test Suite', function () {
beforeEach(function () {
- module('DataFactory');
+ ngMock.module('DataFactory');
- inject(function (Private) {
+ ngMock.inject(function (Private) {
Data = Private(require('ui/vislib/lib/data'));
});
});
diff --git a/src/ui/vislib/__tests__/lib/dispatch.js b/src/ui/vislib/__tests__/lib/dispatch.js
index 805641b8af43..eb6c1f085a0b 100644
--- a/src/ui/vislib/__tests__/lib/dispatch.js
+++ b/src/ui/vislib/__tests__/lib/dispatch.js
@@ -3,6 +3,7 @@ define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var d3 = require('d3');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
// Data
@@ -25,8 +26,8 @@ define(function (require) {
var vis;
var SimpleEmitter;
- beforeEach(module('AreaChartFactory'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('AreaChartFactory'));
+ beforeEach(ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))();
vis.render(data);
SimpleEmitter = require('utils/SimpleEmitter');
@@ -48,8 +49,8 @@ define(function (require) {
describe('Stock event handlers', function () {
var vis;
- beforeEach(module('AreaChartFactory'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('AreaChartFactory'));
+ beforeEach(ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))();
require('ui/vislib/styles/main.less');
@@ -120,8 +121,8 @@ define(function (require) {
it('should attach whatever gets passed on vis.on() to chart.events', function (done) {
var vis;
var chart;
- module('AreaChartFactory');
- inject(function (Private) {
+ ngMock.module('AreaChartFactory');
+ ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))();
vis.on('someEvent', _.noop);
vis.render(data);
@@ -138,8 +139,8 @@ define(function (require) {
it('can be added after rendering', function () {
var vis;
var chart;
- module('AreaChartFactory');
- inject(function (Private) {
+ ngMock.module('AreaChartFactory');
+ ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))();
vis.render(data);
vis.on('someEvent', _.noop);
diff --git a/src/ui/vislib/__tests__/lib/error_handler.js b/src/ui/vislib/__tests__/lib/error_handler.js
index 4179ad5a820d..62e6f0d13cad 100644
--- a/src/ui/vislib/__tests__/lib/error_handler.js
+++ b/src/ui/vislib/__tests__/lib/error_handler.js
@@ -1,6 +1,7 @@
define(function (require) {
var expect = require('expect.js');
var angular = require('angular');
+ var ngMock = require('ngMock');
angular.module('ErrorHandlerFactory', ['kibana']);
describe('VisLib ErrorHandler Test Suite', function () {
@@ -8,11 +9,11 @@ define(function (require) {
var errorHandler;
beforeEach(function () {
- module('ErrorHandlerFactory');
+ ngMock.module('ErrorHandlerFactory');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
ErrorHandler = Private(require('ui/vislib/lib/_error_handler'));
errorHandler = new ErrorHandler();
});
diff --git a/src/ui/vislib/__tests__/lib/handler/handler.js b/src/ui/vislib/__tests__/lib/handler/handler.js
index 7a6f83e1eb96..843f39d184b4 100644
--- a/src/ui/vislib/__tests__/lib/handler/handler.js
+++ b/src/ui/vislib/__tests__/lib/handler/handler.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
// Data
@@ -30,11 +31,11 @@ define(function (require) {
var events;
beforeEach(function () {
- module('HandlerBaseClass');
+ ngMock.module('HandlerBaseClass');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
Handler = Private(require('ui/vislib/lib/handler/handler'));
vis = Private(require('vislib_fixtures/_vis_fixture'))();
require('ui/vislib/styles/main.less');
@@ -109,7 +110,7 @@ define(function (require) {
describe('removeAll Method', function () {
beforeEach(function () {
- inject(function () {
+ ngMock.inject(function () {
vis.handler.removeAll(vis.el);
});
});
diff --git a/src/ui/vislib/__tests__/lib/layout/layout.js b/src/ui/vislib/__tests__/lib/layout/layout.js
index 7df3812365bd..0c347c94d7ab 100644
--- a/src/ui/vislib/__tests__/lib/layout/layout.js
+++ b/src/ui/vislib/__tests__/lib/layout/layout.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
// Data
@@ -31,12 +32,12 @@ define(function (require) {
var testLayout;
beforeEach(function () {
- module('LayoutFactory');
- module('XAxisSplitFactory');
+ ngMock.module('LayoutFactory');
+ ngMock.module('XAxisSplitFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
Layout = Private(require('ui/vislib/lib/layout/layout'));
vis = Private(require('vislib_fixtures/_vis_fixture'))();
require('ui/vislib/styles/main.less');
@@ -136,7 +137,7 @@ define(function (require) {
describe('removeAll Method', function () {
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
d3.select(vis.el).append('div').attr('class', 'visualize');
vis.handler.layout.removeAll(vis.el);
});
diff --git a/src/ui/vislib/__tests__/lib/layout/layout_types.js b/src/ui/vislib/__tests__/lib/layout/layout_types.js
index 035b8cb31cf4..5d6331723d11 100644
--- a/src/ui/vislib/__tests__/lib/layout/layout_types.js
+++ b/src/ui/vislib/__tests__/lib/layout/layout_types.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
angular.module('LayoutTypeFactory', ['kibana']);
@@ -10,11 +11,11 @@ define(function (require) {
var layoutFunc;
beforeEach(function () {
- module('LayoutTypeFactory');
+ ngMock.module('LayoutTypeFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
layoutType = Private(require('ui/vislib/lib/layout/layout_types'));
layoutFunc = layoutType.histogram;
});
diff --git a/src/ui/vislib/__tests__/lib/layout/splits/column_chart/splits.js b/src/ui/vislib/__tests__/lib/layout/splits/column_chart/splits.js
index d7609e3ed563..befc6e9cc9b5 100644
--- a/src/ui/vislib/__tests__/lib/layout/splits/column_chart/splits.js
+++ b/src/ui/vislib/__tests__/lib/layout/splits/column_chart/splits.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
angular.module('ChartSplitFactory', ['kibana']);
@@ -137,14 +138,14 @@ define(function (require) {
};
beforeEach(function () {
- module('ChartSplitFactory');
- module('ChartTitleSplitFactory');
- module('XAxisSplitFactory');
- module('YAxisSplitFactory');
+ ngMock.module('ChartSplitFactory');
+ ngMock.module('ChartTitleSplitFactory');
+ ngMock.module('XAxisSplitFactory');
+ ngMock.module('YAxisSplitFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
chartSplit = Private(require('ui/vislib/lib/layout/splits/column_chart/chart_split'));
chartTitleSplit = Private(require('ui/vislib/lib/layout/splits/column_chart/chart_title_split'));
xAxisSplit = Private(require('ui/vislib/lib/layout/splits/column_chart/x_axis_split'));
@@ -164,7 +165,7 @@ define(function (require) {
var fixture;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
fixture = d3.select('.visualization').call(chartSplit);
});
});
@@ -187,7 +188,7 @@ define(function (require) {
var fixture;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
el.append('div').attr('class', 'x-axis-chart-title');
el.append('div').attr('class', 'y-axis-chart-title');
d3.select('.x-axis-chart-title').call(chartTitleSplit);
@@ -229,7 +230,7 @@ define(function (require) {
var divs;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
fixture = d3.select('body').append('div')
.attr('class', 'columns')
.datum({ columns: [{}, {}] });
@@ -253,7 +254,7 @@ define(function (require) {
var divs;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
fixture = d3.select('body').append('div')
.attr('class', 'rows')
.datum({ rows: [{}, {}] });
diff --git a/src/ui/vislib/__tests__/lib/layout/types/column_layout.js b/src/ui/vislib/__tests__/lib/layout/types/column_layout.js
index 8e24a5969324..bcb0a9c337e2 100644
--- a/src/ui/vislib/__tests__/lib/layout/types/column_layout.js
+++ b/src/ui/vislib/__tests__/lib/layout/types/column_layout.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
angular.module('ColumnLayoutFactory', ['kibana']);
@@ -69,11 +70,11 @@ define(function (require) {
};
beforeEach(function () {
- module('ColumnLayoutFactory');
+ ngMock.module('ColumnLayoutFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
layoutType = Private(require('ui/vislib/lib/layout/layout_types'));
el = d3.select('body').append('div').attr('class', 'visualization');
columnLayout = layoutType.histogram(el, data);
diff --git a/src/ui/vislib/__tests__/lib/legend.js b/src/ui/vislib/__tests__/lib/legend.js
index eda778de6a57..0c4e6cd1f084 100644
--- a/src/ui/vislib/__tests__/lib/legend.js
+++ b/src/ui/vislib/__tests__/lib/legend.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var slices = require('vislib_fixtures/mock_data/histogram/_slices');
@@ -44,11 +45,11 @@ define(function (require) {
var $el;
beforeEach(function () {
- module('LegendFactory');
+ ngMock.module('LegendFactory');
});
beforeEach(function () {
- inject(function (Private, d3) {
+ ngMock.inject(function (Private, d3) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
Legend = Private(require('ui/vislib/lib/legend'));
require('ui/vislib/styles/main.less');
diff --git a/src/ui/vislib/__tests__/lib/resize_checker.js b/src/ui/vislib/__tests__/lib/resize_checker.js
index d7ff7897134b..865a95667c27 100644
--- a/src/ui/vislib/__tests__/lib/resize_checker.js
+++ b/src/ui/vislib/__tests__/lib/resize_checker.js
@@ -3,6 +3,7 @@ define(function (require) {
var $ = require('jquery');
var _ = require('lodash');
var Promise = require('bluebird');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var sinon = require('auto-release-sinon/mocha');
@@ -14,9 +15,9 @@ define(function (require) {
var reflowWatcher;
var reflowSpies = {};
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.inject(function (Private) {
window.DISABLE_RESIZE_CHECKER = false;
ResizeChecker = Private(require('ui/vislib/lib/resize_checker'));
EventEmitter = Private(require('ui/events'));
diff --git a/src/ui/vislib/__tests__/lib/x_axis.js b/src/ui/vislib/__tests__/lib/x_axis.js
index 176173f6017f..d0e593776646 100644
--- a/src/ui/vislib/__tests__/lib/x_axis.js
+++ b/src/ui/vislib/__tests__/lib/x_axis.js
@@ -2,6 +2,7 @@ define(function (require) {
var angular = require('angular');
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
angular.module('XAxisFactory', ['kibana']);
@@ -76,11 +77,11 @@ define(function (require) {
};
beforeEach(function () {
- module('XAxisFactory');
+ ngMock.module('XAxisFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
Data = Private(require('ui/vislib/lib/data'));
XAxis = Private(require('ui/vislib/lib/x_axis'));
diff --git a/src/ui/vislib/__tests__/lib/y_axis.js b/src/ui/vislib/__tests__/lib/y_axis.js
index 11d990110f9a..32543545ac1d 100644
--- a/src/ui/vislib/__tests__/lib/y_axis.js
+++ b/src/ui/vislib/__tests__/lib/y_axis.js
@@ -2,6 +2,7 @@ define(function (require) {
var _ = require('lodash');
var d3 = require('d3');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var YAxis;
@@ -92,9 +93,9 @@ define(function (require) {
describe('Vislib yAxis Class Test Suite', function () {
var d3Provider;
- beforeEach(module('kibana'));
+ beforeEach(ngMock.module('kibana'));
- beforeEach(inject(function (Private, _d3_) {
+ beforeEach(ngMock.inject(function (Private, _d3_) {
d3Provider = _d3_;
Data = Private(require('ui/vislib/lib/data'));
YAxis = Private(require('ui/vislib/lib/y_axis'));
diff --git a/src/ui/vislib/__tests__/vis.js b/src/ui/vislib/__tests__/vis.js
index eab91704f824..7e3bfe2a8393 100644
--- a/src/ui/vislib/__tests__/vis.js
+++ b/src/ui/vislib/__tests__/vis.js
@@ -2,6 +2,7 @@ define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var series = require('vislib_fixtures/mock_data/date_histogram/_series');
var columns = require('vislib_fixtures/mock_data/date_histogram/_columns');
@@ -32,11 +33,11 @@ define(function (require) {
var numberOfCharts;
beforeEach(function () {
- module('VisFactory');
+ ngMock.module('VisFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))();
secondVis = Private(require('vislib_fixtures/_vis_fixture'))();
require('ui/vislib/styles/main.less');
diff --git a/src/ui/vislib/__tests__/visualizations/area_chart.js b/src/ui/vislib/__tests__/visualizations/area_chart.js
index 2f0267bc614a..f6ac01fa9ffe 100644
--- a/src/ui/vislib/__tests__/visualizations/area_chart.js
+++ b/src/ui/vislib/__tests__/visualizations/area_chart.js
@@ -1,7 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
-
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
@@ -44,11 +44,11 @@ define(function (require) {
var vis;
beforeEach(function () {
- module('AreaChartFactory');
+ ngMock.module('AreaChartFactory');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
require('ui/vislib/styles/main.less');
@@ -67,7 +67,7 @@ define(function (require) {
var notEnoughData;
beforeEach(function () {
- inject(function () {
+ ngMock.inject(function () {
notEnoughData = require('vislib_fixtures/mock_data/not_enough_data/_one_point');
require('ui/vislib/styles/main.less');
@@ -90,7 +90,7 @@ define(function (require) {
var enoughData;
beforeEach(function () {
- inject(function () {
+ ngMock.inject(function () {
enoughData = require('vislib_fixtures/mock_data/date_histogram/_series');
require('ui/vislib/styles/main.less');
@@ -145,7 +145,7 @@ define(function (require) {
var onMouseOver;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
vis.handler.charts.forEach(function (chart) {
circle = $(chart.chartEl).find('circle')[0];
brush = $(chart.chartEl).find('.brush');
diff --git a/src/ui/vislib/__tests__/visualizations/chart.js b/src/ui/vislib/__tests__/visualizations/chart.js
index 53aa88b79090..4a352141fc74 100644
--- a/src/ui/vislib/__tests__/visualizations/chart.js
+++ b/src/ui/vislib/__tests__/visualizations/chart.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
angular.module('ChartBaseClass', ['kibana']);
angular.module('ColumnChartFactory', ['kibana']);
@@ -81,12 +82,12 @@ define(function (require) {
};
beforeEach(function () {
- module('ChartBaseClass');
- module('ColumnChartFactory');
+ ngMock.module('ChartBaseClass');
+ ngMock.module('ColumnChartFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
Vis = Private(require('ui/vislib/vis'));
Data = Private(require('ui/vislib/lib/data'));
ColumnChart = Private(require('ui/vislib/visualizations/column_chart'));
diff --git a/src/ui/vislib/__tests__/visualizations/column_chart.js b/src/ui/vislib/__tests__/visualizations/column_chart.js
index 9e6b3f7feb09..92a425df2417 100644
--- a/src/ui/vislib/__tests__/visualizations/column_chart.js
+++ b/src/ui/vislib/__tests__/visualizations/column_chart.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
var d3 = require('d3');
@@ -40,11 +41,11 @@ define(function (require) {
};
beforeEach(function () {
- module('AreaChartFactory');
+ ngMock.module('AreaChartFactory');
});
beforeEach(function () {
- inject(function (Private) {
+ ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
require('ui/vislib/styles/main.less');
diff --git a/src/ui/vislib/__tests__/visualizations/line_chart.js b/src/ui/vislib/__tests__/visualizations/line_chart.js
index 0eb7b2fe26bf..3e3f78c19d0d 100644
--- a/src/ui/vislib/__tests__/visualizations/line_chart.js
+++ b/src/ui/vislib/__tests__/visualizations/line_chart.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
@@ -32,7 +33,7 @@ define(function (require) {
var vis;
beforeEach(function () {
- module('LineChartFactory');
+ ngMock.module('LineChartFactory');
});
beforeEach(function () {
@@ -43,7 +44,7 @@ define(function (require) {
drawLinesBetweenPoints: true
};
- inject(function (Private) {
+ ngMock.inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
require('ui/vislib/styles/main.less');
@@ -67,7 +68,7 @@ define(function (require) {
var onMouseOver;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
vis.handler.charts.forEach(function (chart) {
circle = $(chart.chartEl).find('.circle')[0];
brush = $(chart.chartEl).find('.brush');
diff --git a/src/ui/vislib/__tests__/visualizations/pie_chart.js b/src/ui/vislib/__tests__/visualizations/pie_chart.js
index dc21c378645c..b20f5fc456f3 100644
--- a/src/ui/vislib/__tests__/visualizations/pie_chart.js
+++ b/src/ui/vislib/__tests__/visualizations/pie_chart.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
var fixtures = require('fixtures/fake_hierarchical_data');
@@ -70,11 +71,11 @@ define(function (require) {
var data2;
beforeEach(function () {
- module('PieChartFactory');
+ ngMock.module('PieChartFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
chart1 = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams1);
chart2 = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams2);
Vis = Private(require('ui/vis/vis'));
@@ -170,11 +171,11 @@ define(function (require) {
var data;
beforeEach(function () {
- module('PieChartFactory');
+ ngMock.module('PieChartFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
Vis = Private(require('ui/vis/vis'));
indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
@@ -208,7 +209,7 @@ define(function (require) {
var onMouseOver;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
vis.handler.charts.forEach(function (chart) {
path = $(chart.chartEl).find('path')[0];
d3selectedPath = d3.select(path)[0][0];
@@ -240,7 +241,7 @@ define(function (require) {
var slices;
beforeEach(function () {
- inject(function (d3) {
+ ngMock.inject(function (d3) {
vis.handler.charts.forEach(function (chart) {
width = $(chart.chartEl).width();
height = $(chart.chartEl).height();
diff --git a/src/ui/vislib/__tests__/visualizations/tile_maps/map.js b/src/ui/vislib/__tests__/visualizations/tile_maps/map.js
index 4c918c829c97..ed511f5f488e 100644
--- a/src/ui/vislib/__tests__/visualizations/tile_maps/map.js
+++ b/src/ui/vislib/__tests__/visualizations/tile_maps/map.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
var L = require('leaflet');
@@ -33,8 +34,8 @@ define(function (require) {
var leafletMocks = {};
beforeEach(function () {
- module('MapFactory');
- inject(function (Private) {
+ ngMock.module('MapFactory');
+ ngMock.inject(function (Private) {
// mock parts of leaflet
leafletMocks.tileLayer = { on: sinon.stub() };
leafletMocks.map = { on: sinon.stub() };
diff --git a/src/ui/vislib/__tests__/visualizations/tile_maps/markers.js b/src/ui/vislib/__tests__/visualizations/tile_maps/markers.js
index 9aea2da1b0eb..78be4ddae1b2 100644
--- a/src/ui/vislib/__tests__/visualizations/tile_maps/markers.js
+++ b/src/ui/vislib/__tests__/visualizations/tile_maps/markers.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
var L = require('leaflet');
@@ -62,8 +63,8 @@ define(function (require) {
var MarkerClass;
beforeEach(function () {
- module('MarkerFactory');
- inject(function (Private) {
+ ngMock.module('MarkerFactory');
+ ngMock.inject(function (Private) {
MarkerClass = Private(require('ui/vislib/visualizations/marker_types/base_marker'));
markerLayer = createMarker(MarkerClass);
});
@@ -198,8 +199,8 @@ define(function (require) {
describe('Shaded Circles', function () {
beforeEach(function () {
- module('MarkerFactory');
- inject(function (Private) {
+ ngMock.module('MarkerFactory');
+ ngMock.inject(function (Private) {
var MarkerClass = Private(require('ui/vislib/visualizations/marker_types/shaded_circles'));
markerLayer = createMarker(MarkerClass);
});
@@ -220,12 +221,12 @@ define(function (require) {
var zoom;
beforeEach(function () {
- module('MarkerFactory');
+ ngMock.module('MarkerFactory');
zoom = _.random(1, 18);
sinon.stub(mockMap, 'getZoom', _.constant(zoom));
- inject(function (Private) {
+ ngMock.inject(function (Private) {
var MarkerClass = Private(require('ui/vislib/visualizations/marker_types/scaled_circles'));
markerLayer = createMarker(MarkerClass);
});
@@ -271,9 +272,9 @@ define(function (require) {
describe('Heatmaps', function () {
beforeEach(function () {
- module('MarkerFactory');
+ ngMock.module('MarkerFactory');
- inject(function (Private) {
+ ngMock.inject(function (Private) {
var MarkerClass = Private(require('ui/vislib/visualizations/marker_types/heatmap'));
markerLayer = createMarker(MarkerClass);
});
diff --git a/src/ui/vislib/__tests__/visualizations/tile_maps/tile_map.js b/src/ui/vislib/__tests__/visualizations/tile_maps/tile_map.js
index b5dde2f45511..e02278615249 100644
--- a/src/ui/vislib/__tests__/visualizations/tile_maps/tile_map.js
+++ b/src/ui/vislib/__tests__/visualizations/tile_maps/tile_map.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
var sinon = require('auto-release-sinon/mocha');
@@ -28,8 +29,8 @@ define(function (require) {
var tilemap;
beforeEach(function () {
- module('TileMapFactory');
- inject(function (Private) {
+ ngMock.module('TileMapFactory');
+ ngMock.inject(function (Private) {
Private.stub(require('ui/vislib/visualizations/_map'), MockMap);
TileMap = Private(require('ui/vislib/visualizations/tile_map'));
extentsStub = sinon.stub(TileMap.prototype, '_appendGeoExtents', _.noop);
diff --git a/src/ui/vislib/__tests__/visualizations/time_marker.js b/src/ui/vislib/__tests__/visualizations/time_marker.js
index 68b63c98299e..a6d510765cfd 100644
--- a/src/ui/vislib/__tests__/visualizations/time_marker.js
+++ b/src/ui/vislib/__tests__/visualizations/time_marker.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
var $ = require('jquery');
var fixtures = require('fixtures/fake_hierarchical_data');
@@ -42,11 +43,11 @@ define(function (require) {
var domain;
beforeEach(function () {
- module('TimeMarkerFactory');
+ ngMock.module('TimeMarkerFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
TimeMarker = Private(require('ui/vislib/visualizations/time_marker'));
minDomain = getExtent(series.series, d3.min);
maxDomain = getExtent(series.series, d3.max);
diff --git a/src/ui/vislib/__tests__/visualizations/vis_types.js b/src/ui/vislib/__tests__/visualizations/vis_types.js
index 83c60003bbcd..991d1134e461 100644
--- a/src/ui/vislib/__tests__/visualizations/vis_types.js
+++ b/src/ui/vislib/__tests__/visualizations/vis_types.js
@@ -1,6 +1,7 @@
define(function (require) {
var angular = require('angular');
var expect = require('expect.js');
+ var ngMock = require('ngMock');
var _ = require('lodash');
angular.module('VisTypeFactory', ['kibana']);
@@ -10,11 +11,11 @@ define(function (require) {
var visFunc;
beforeEach(function () {
- module('VisTypeFactory');
+ ngMock.module('VisTypeFactory');
});
beforeEach(function () {
- inject(function (d3, Private) {
+ ngMock.inject(function (d3, Private) {
visTypes = Private(require('ui/vislib/visualizations/vis_types'));
visFunc = visTypes.histogram;
});
diff --git a/src/ui/vislib_vis_type/__tests__/_VislibRenderbot.js b/src/ui/vislib_vis_type/__tests__/_VislibRenderbot.js
index cbd442af3a3a..b7e335e385e1 100644
--- a/src/ui/vislib_vis_type/__tests__/_VislibRenderbot.js
+++ b/src/ui/vislib_vis_type/__tests__/_VislibRenderbot.js
@@ -2,6 +2,7 @@ define(function (require) {
return ['renderbot', function exportWrapper() {
var _ = require('lodash');
var $ = require('jquery');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var sinon = require('auto-release-sinon/mocha');
var vislib;
@@ -14,9 +15,9 @@ define(function (require) {
};
function init() {
- module('kibana');
+ ngMock.module('kibana');
- inject(function ($injector, Private, _vislib_) {
+ ngMock.inject(function ($injector, Private, _vislib_) {
vislib = _vislib_;
Vis = Private(require('ui/vislib/vis'));
Renderbot = Private(require('ui/vis/Renderbot'));
diff --git a/src/ui/vislib_vis_type/__tests__/_buildChartData.js b/src/ui/vislib_vis_type/__tests__/_buildChartData.js
index 8ff960c58682..835d87c58145 100644
--- a/src/ui/vislib_vis_type/__tests__/_buildChartData.js
+++ b/src/ui/vislib_vis_type/__tests__/_buildChartData.js
@@ -1,6 +1,7 @@
define(function (require) {
return ['renderbot#buildChartData', function () {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
var sinon = require('auto-release-sinon/mocha');
@@ -10,8 +11,8 @@ define(function (require) {
var TableGroup;
var Table;
- beforeEach(module('kibana'));
- beforeEach(inject(function (Private) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function (Private) {
Table = Private(require('ui/agg_response/tabify/_table'));
TableGroup = Private(require('ui/agg_response/tabify/_table_group'));
aggResponse = Private(require('ui/agg_response/index'));
diff --git a/src/ui/watch_multi/__tests__/watch_multi.js b/src/ui/watch_multi/__tests__/watch_multi.js
index 05afcc611ac1..7b44fe0008b7 100644
--- a/src/ui/watch_multi/__tests__/watch_multi.js
+++ b/src/ui/watch_multi/__tests__/watch_multi.js
@@ -1,5 +1,6 @@
define(function (require) {
var _ = require('lodash');
+ var ngMock = require('ngMock');
var expect = require('expect.js');
describe('$scope.$watchMulti', function () {
@@ -8,8 +9,8 @@ define(function (require) {
var $rootScope;
var $scope;
- beforeEach(module('kibana'));
- beforeEach(inject(function ($injector) {
+ beforeEach(ngMock.module('kibana'));
+ beforeEach(ngMock.inject(function ($injector) {
$rootScope = $injector.get('$rootScope');
$scope = $rootScope.$new();
}));