Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright 2015 Google Inc. All rights reserved. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | --> |
| 16 | <!DOCTYPE html> |
| 17 | <meta charset="UTF-8" /> |
| 18 | <link rel="stylesheet" href="node_modules/mocha/mocha.css" /> |
| 19 | <script src="node_modules/mocha/mocha.js"></script> |
| 20 | <script src="node_modules/chai/chai.js"></script> |
| 21 | <link rel="stylesheet" type="text/css" href="dist/dialog-polyfill.css" /> |
| 22 | <script src="dist/dialog-polyfill.js"></script> |
| 23 | <script> |
| 24 | |
| 25 | var assert = chai.assert; |
| 26 | mocha.setup({ ui: 'tdd' }); |
| 27 | |
| 28 | (function() { |
| 29 | var pageError = null; |
| 30 | |
| 31 | window.addEventListener('error', function(event) { |
| 32 | pageError = event.filename + ':' + event.lineno + ' ' + event.message; |
| 33 | }); |
| 34 | |
| 35 | window.addEventListener('load', function() { |
| 36 | if (pageError) { |
| 37 | suite('page-script-errors', function() { |
| 38 | test('no script errors on page', function() { |
| 39 | assert.fail(null, null, pageError); |
| 40 | }); |
| 41 | }); |
| 42 | } |
| 43 | mocha.run(); |
| 44 | }); |
| 45 | })(); |
| 46 | |
| 47 | </script> |
| 48 | <div id="mocha"></div> |
| 49 | <script src="suite.js"></script> |