Advertisement
SRD75

runTest

Nov 20th, 2018
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.18 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8"/>
  5.         <title>TDD Project - Steve Doig</title>
  6.         <style>
  7.             #container {width: 600px; max-width: 100%; margin: 1em auto;}
  8.         </style>
  9.         <link rel="stylesheet" href="../node_modules/mocha/mocha.css">
  10.     </head>
  11.     <body>
  12.         <div id="container">
  13.             <form id="dataForm" onsubmit="return runTest()">
  14.                 <input type="text" id="text" placeholder="enter some text" required maxlength="10" pattern="^[a-z,A-Z]{1,10}$"><br />
  15.                 <input type="text" id="number" placeholder="enter a number" required maxlength="10" pattern="\d{10}"><br />
  16.                 <button id="submitTest">Submit</button>
  17.             </form>
  18.         </div>
  19.         <script>
  20.             document.getElementById("dataForm").submit();
  21.         </script>
  22.         <div id="mocha"></div>
  23.         <script src="../node_modules/mocha/mocha.js"></script>
  24.         <script src="../node_modules/chai/chai.js"></script>
  25.         <script>mocha.setup('bdd')</script>
  26.  
  27.         <script src="../test/test2.js"></script>
  28.  
  29.         <script>
  30.             mocha.run();
  31.         </script>
  32.     </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement