Don't fail failed tests by accessing undefined members
If a plugin didn't recognize something it should have recognized, don't fail in checking whether it failed. Also, semicolons.
This commit is contained in:
parent
f2bfb3444e
commit
230e33136c
1 changed files with 8 additions and 5 deletions
|
@ -1,12 +1,15 @@
|
|||
/* plugins go here */
|
||||
|
||||
var msg = function(msg) {
|
||||
return {'text': msg }
|
||||
}
|
||||
return {'text': msg };
|
||||
};
|
||||
|
||||
var metadata_name = function(message) {
|
||||
return message['metadata'][0]['name']
|
||||
}
|
||||
if (message.metadata && message.metadata[0] && message.metadata[0].name) {
|
||||
return message.metadata[0].name;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
var expectTheseMessagesToContain = function(urls, pluginType, plugins) {
|
||||
for (var i = 0; i < urls.length; i++) {
|
||||
|
@ -16,7 +19,7 @@ var expectTheseMessagesToContain = function(urls, pluginType, plugins) {
|
|||
)
|
||||
).toEqual(pluginType);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
describe('filter', function() {
|
||||
beforeEach(module('plugins'));
|
||||
|
|
Loading…
Reference in a new issue