parent
583f5b0abe
commit
341fa9f616
@ -0,0 +1,34 @@ |
|||||||
|
module.exports = function(config){ |
||||||
|
config.set({ |
||||||
|
|
||||||
|
basePath : '../', |
||||||
|
|
||||||
|
files : [ |
||||||
|
'bower_components/angular/angular.js', |
||||||
|
'bower_components/angular-route/angular-route.js', |
||||||
|
'bower_components/angular-mocks/angular-mocks.js', |
||||||
|
'js/**/*.js', |
||||||
|
'test/unit/**/*.js' |
||||||
|
], |
||||||
|
|
||||||
|
autoWatch : true, |
||||||
|
|
||||||
|
frameworks: ['jasmine'], |
||||||
|
|
||||||
|
browsers : ['PhantomJS'], |
||||||
|
|
||||||
|
singleRun: true, |
||||||
|
|
||||||
|
plugins : [ |
||||||
|
'karma-phantomjs-launcher', |
||||||
|
'karma-jasmine', |
||||||
|
'karma-junit-reporter' |
||||||
|
], |
||||||
|
|
||||||
|
junitReporter : { |
||||||
|
outputFile: 'test_out/unit.xml', |
||||||
|
suite: 'unit' |
||||||
|
} |
||||||
|
|
||||||
|
}); |
||||||
|
}; |
@ -0,0 +1,29 @@ |
|||||||
|
/* plugins go here */ |
||||||
|
|
||||||
|
var msg = function(msg) { |
||||||
|
return {'text': msg } |
||||||
|
} |
||||||
|
|
||||||
|
var metadata_name = function(message) { |
||||||
|
return message['metadata'][0]['name'] |
||||||
|
} |
||||||
|
|
||||||
|
describe('filter', function() { |
||||||
|
beforeEach(module('plugins')); |
||||||
|
|
||||||
|
|
||||||
|
describe('Plugins', function() { |
||||||
|
beforeEach(module(function($provide) { |
||||||
|
$provide.value('version', 'TEST_VER'); |
||||||
|
})); |
||||||
|
|
||||||
|
|
||||||
|
it('should recognize youtube videos', inject(function(plugins) { |
||||||
|
expect( |
||||||
|
metadata_name( |
||||||
|
plugins.PluginManager.contentForMessage(msg('https://www.youtube.com/watch?v=dQw4w9WgXcQ')) |
||||||
|
) |
||||||
|
).toEqual('YouTube video'); |
||||||
|
})); |
||||||
|
}); |
||||||
|
}); |
Loading…
Reference in new issue