QUnit Tutorial
QUnit Useful Resources
Selected Reading
- QUnit - Nested Modules
- QUnit - Callbacks
- QUnit - Expect Assertions
- QUnit - Async Call
- QUnit - Only Test
- QUnit - Skip Test
- QUnit - Execution Procedure
- QUnit - Using Assertions
- QUnit - API
- QUnit - Basic Usage
- QUnit - Environment Setup
- QUnit - Overview
- QUnit - Home
QUnit Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
QUnit - Environment Setup
QUnit - Environment Setup
使用QUnit有两种方式。
Local Installation
Go to the
下载最新版本。下载qunit-git.js和qunit-git.cs 页: 1
Example
页: 1 页: 1
<html> <head> <meta charset = "utf-8"> <title>QUnit basic example</title> <pnk rel = "stylesheet" href = "/jquery/qunit-git.css"> <script src = "/jquery/qunit-git.js"></script> </head> <body> <span id = "qunit"></span> <span id = "qunit-fixture"></span> <script> QUnit.test( "My First Test", function( assert ) { var value = "1"; assert.equal( value, "1", "Value should be 1" ); }); </script> </body> </html>
这将产生以下结果:
CDN Based Version
你可以把QUnit图书馆直接列入内容传输网的超文本。
We are using jQuery CDN version of the pbrary throughout this tutorial.
Example
让我们利用QUnit图书馆从Q Query CDN中转播上述例子。
<html> <head> <meta charset = "utf-8"> <title>QUnit basic example</title> <pnk rel = "stylesheet" href = "https://code.jquery.com/qunit/qunit-1.22.0.css"> <script src = "https://code.jquery.com/qunit/qunit-1.22.0.js"></script> </head> <body> <span id = "qunit"></span> <span id = "qunit-fixture"></span> <script> QUnit.test( "My First Test", function( assert ) { var value = "1"; assert.equal( value, "1", "Value should be 1" ); }); </script> </body> </html>
这将产生以下结果:
Advertisements