Skip to content
Snippets Groups Projects
Commit 12f9f581 authored by Tom Robinson's avatar Tom Robinson
Browse files

Add a 'real' test

parent d60ed991
No related branches found
No related tags found
No related merge requests found
......@@ -22,3 +22,4 @@ profiles.clj
/node_modules/
/.js_hint_output/
/.babel_cache
/coverage
'use strict';
var webpackConfig = require('./webpack.config');
webpackConfig.cache = true;
webpackConfig.module.postLoaders = [{
test: /\.js$/,
exclude: /(_spec|vendor|node_modules)/,
loader: 'istanbul-instrumenter'
}];
webpackConfig.module.postLoaders = [
{ test: /\.js$/, exclude: /(_spec|vendor|node_modules)/, loader: 'istanbul-instrumenter' }
];
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'resources/frontend_client/app/**/*.spec.js'
],
webpack: {
resolve: webpackConfig.resolve,
module: webpackConfig.module
},
preprocessors: {
'resources/frontend_client/app/**/*.spec.js': ['webpack']
},
reporters: [
'progress',
'coverage'
],
coverageReporter: {
dir: 'coverage/',
subdir: function (browser) {
return browser.toLowerCase().split(/[ /-]/)[0];
},
reporters: [
{type: 'cobertura', file: 'cobertura.xml'},
{type: 'text', file: 'text.txt'},
{type: 'text-summary', file: 'text-summary.txt'},
{type: 'html'}
]
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: true
});
module.exports = function(config) {
config.set({
basePath: '',
files: [
'resources/frontend_client/app/dist/vendor.js',
// 'resources/frontend_client/vendor.js',
'node_modules/angular-mocks/angular-mocks.js',
'resources/frontend_client/app/dist/app.js',
'resources/frontend_client/app/**/*.spec.js'
],
exclude: [
],
preprocessors: {
'resources/frontend_client/vendor.js': ['webpack'],
'resources/frontend_client/app/**/*.spec.js': ['webpack']
},
frameworks: [
'jasmine'
],
reporters: [
'progress',
'coverage'
],
webpack: {
resolve: webpackConfig.resolve,
module: webpackConfig.module
},
coverageReporter: {
dir: 'coverage/',
subdir: function(browser) {
return browser.toLowerCase().split(/[ /-]/)[0];
},
reporters: [
{ type: 'text', file: 'text.txt' },
{ type: 'text-summary', file: 'text-summary.txt' },
{ type: 'html' }
]
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['Chrome'],
autoWatch: true,
singleRun: false
});
};
'use strict';
// Metabase Services
var MetabaseServices = angular.module('corvus.metabase.services', ['ngResource', 'ngCookies']);
var MetabaseServices = angular.module('corvus.metabase.services', [
'ngResource',
'ngCookies',
'corvus.services'
]);
MetabaseServices.factory('Metabase', ['$resource', '$cookies', 'CorvusCore', function($resource, $cookies, CorvusCore) {
return $resource('/api/meta', {}, {
......@@ -335,4 +339,4 @@ MetabaseServices.factory('TableSegment', ['$resource', '$cookies', function($res
},
});
}]);
\ No newline at end of file
}]);
'use strict';
import angular from 'angular';
import 'angular-mocks';
describe('Hello Service', function () {
describe('.hello', function () {
it('1 should equal 1', function () {
expect(1).toEqual(1);
});
});
});
'use strict';
import 'metabase/services';
import 'metabase/metabase/metabase.services';
describe('corvus.metabase.services', function() {
beforeEach(angular.mock.module('corvus.metabase.services'));
describe('Metabase Service', function() {
it('should return current version', inject(function(Metabase, $httpBackend) {
$httpBackend.expect('GET', '/api/meta/db/?org=')
.respond(200, '[]');
Metabase.db_list().$promise.then(function(data) {
expect(data.length).toEqual(0);
});
$httpBackend.flush();
}));
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment