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 - Only Test
QUnit - Only Test
有时,我们的法典尚未准备好,而为测试这一方法/编码而撰写的测试案例如果运行就失败了。 www.un.org/chinese/ga/president 在这方面提供帮助。 只使用一种方法书写的测试方法将在不进行其他测试的情况下实施。 如果只规定一种以上的方法,那么只有第一个方法才能执行。 只见行动方法。
<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.module( "Module A", { beforeEach: function( assert ) { assert.ok( true, "before test case" ); }, afterEach: function( assert ) { assert.ok( true, "after test case" ); } }); QUnit.test( "test case 1", function( assert ) { assert.ok( true, "Module A: in test case 1" ); }); QUnit.only( "test case 2", function( assert ) { assert.ok( true, "Module A: in test case 2" ); }); QUnit.test( "test case 3", function( assert ) { assert.ok( true, "Module A: in test case 3" ); }); QUnit.test( "test case 4", function( assert ) { assert.ok( true, "Module A: in test case 4" ); }); </script> </body> </html>
Verify the Output
你应当看到以下结果:
Advertisements