Bug 1064218 - Detect syntax failures in Loop's unit tests. r=nperriault

This commit is contained in:
Mark Banner 2014-12-01 14:37:06 -08:00
Родитель c8926c6aaf
Коммит ddee53c551
4 изменённых файлов: 43 добавлений и 2 удалений

Просмотреть файл

@ -14,6 +14,13 @@
</div>
<div id="messages"></div>
<div id="fixtures"></div>
<script>
var uncaughtError;
window.addEventListener("error", function(error) {
uncaughtError = error;
});
</script>
<!-- libs -->
<script src="../../content/libs/l10n.js"></script>
<script src="../../content/shared/libs/react-0.11.2.js"></script>
@ -68,6 +75,13 @@
// Stop the default init functions running to avoid conflicts in tests
document.removeEventListener('DOMContentLoaded', loop.panel.init);
document.removeEventListener('DOMContentLoaded', loop.conversation.init);
describe("Uncaught Error Check", function() {
it("should load the tests without errors", function() {
expect(uncaughtError && uncaughtError.message).to.be.undefined;
});
});
mocha.run(function () {
$("#mocha").append("<p id='complete'>Complete.</p>");
});

Просмотреть файл

@ -14,6 +14,12 @@
</div>
<div id="messages"></div>
<div id="fixtures"></div>
<script>
var uncaughtError;
window.addEventListener("error", function(error) {
uncaughtError = error;
});
</script>
<!-- libs -->
<script src="../../content/shared/libs/react-0.11.2.js"></script>
@ -67,6 +73,12 @@
<script src="store_test.js"></script>
<script src="roomStore_test.js"></script>
<script>
describe("Uncaught Error Check", function() {
it("should load the tests without errors", function() {
expect(uncaughtError && uncaughtError.message).to.be.undefined;
});
});
mocha.run(function () {
$("#mocha").append("<p id='complete'>Complete.</p>");
});

Просмотреть файл

@ -42,7 +42,9 @@ describe("loop.shared.models", function() {
initPublisher: sandbox.spy(),
initSession: sandbox.stub().returns(fakeSession)
};
fakeMozLoop = {};
fakeMozLoop = {
addConversationContext: sinon.spy()
};
});
afterEach(function() {
@ -63,7 +65,7 @@ describe("loop.shared.models", function() {
beforeEach(function() {
conversation = new sharedModels.ConversationModel({}, {
sdk: fakeSDK
sdk: fakeSDK,
mozLoop: fakeMozLoop
});
conversation.set("loopToken", "fakeToken");

Просмотреть файл

@ -15,6 +15,13 @@
</div>
<div id="messages"></div>
<div id="fixtures"></div>
<script>
var uncaughtError;
window.addEventListener("error", function(error) {
uncaughtError = error;
});
</script>
<!-- libs -->
<script src="../../content/shared/libs/react-0.11.2.js"></script>
<script src="../../content/shared/libs/jquery-2.1.0.js"></script>
@ -59,6 +66,12 @@
<script src="webapp_test.js"></script>
<script src="multiplexGum_test.js"></script>
<script>
describe("Uncaught Error Check", function() {
it("should load the tests without errors", function() {
expect(uncaughtError && uncaughtError.message).to.be.undefined;
});
});
mocha.run(function () {
$("#mocha").append("<p id='complete'>Complete.</p>");
});