2014-10-09 13:23:28 +00:00
|
|
|
---
|
|
|
|
title: Mocha HTML
|
2015-11-24 05:02:17 +00:00
|
|
|
category: JavaScript libraries
|
2014-10-09 13:23:28 +00:00
|
|
|
---
|
|
|
|
|
2023-03-14 04:40:29 +00:00
|
|
|
### About
|
|
|
|
|
2014-10-09 13:26:22 +00:00
|
|
|
This is a mocha template that loads js/css from cdn.
|
|
|
|
|
2023-03-14 04:40:29 +00:00
|
|
|
### Template
|
|
|
|
|
2015-06-10 07:12:56 +00:00
|
|
|
```html
|
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2015-07-16 20:19:25 +00:00
|
|
|
<meta charset='utf-8'>
|
2015-06-10 07:12:56 +00:00
|
|
|
<title>Mocha</title>
|
2015-07-16 20:19:25 +00:00
|
|
|
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
|
|
|
<link href='https://cdn.rawgit.com/mochajs/mocha/2.2.5/mocha.css' rel='stylesheet' />
|
2015-06-10 07:12:56 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2015-07-16 20:19:25 +00:00
|
|
|
<div id='mocha'></div>
|
|
|
|
<script src='https://cdn.rawgit.com/mochajs/mocha/2.2.5/mocha.js'></script>
|
|
|
|
<script src='https://cdn.rawgit.com/chaijs/chai/2.3.0/chai.js'></script>
|
|
|
|
<script>window.onerror=function(msg,url,line){document.getElementById('mocha').innerHTML+='<h1>'+msg+'</'+'h1>'+'<h2>'+url+':'+line+'</'+'h2>';return false}</script>
|
|
|
|
<script>mocha.setup('bdd')</script>
|
|
|
|
<!-- what to test: -->
|
|
|
|
<script src='../index.js'></script>
|
|
|
|
<!-- tests to run: -->
|
|
|
|
<script src='first_test.js'></script>
|
|
|
|
<script src='second_test.js'></script>
|
2015-06-10 07:12:56 +00:00
|
|
|
<script>mocha.run()</script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
```
|