From 0f6589a92ccf4bd0d614fa2fc20a847ec27de86c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 2 Jul 2024 21:36:10 +0100 Subject: [PATCH] Docs: Add list of "Guides", and "Support" section to Getting Started Promote a curated list of guides on the Getting Started page. his replaces the last of the lost pathways that the Cookbook ffered on the original website. https://github.com/qunitjs/qunitjs.com/issues/151 https://web.archive.org/web/20160303175442/http://qunitjs.com/cookbook/#efficient-development https://github.com/qunitjs/qunitjs.com/blob/v2.10.2/pages/cookbook.html Improve visibility of the chat room and issue tracker as well, by pointing to them directly from the Getting Started page. They are also at the bottom of the homepage, but the main CTA points away from there so this seems worth repeating in prose here. --- README.md | 4 ++-- docs/Gemfile | 2 +- docs/_config.yml | 2 +- docs/api/QUnit/test.md | 1 + docs/api/assert/rejects.md | 1 + docs/intro.md | 24 ++++++++++++++++++------ 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 85b6f2ceb..2111adf1b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Continuous integration](https://github.com/qunitjs/qunit/actions/workflows/CI.yaml/badge.svg)](https://github.com/qunitjs/qunit/actions/workflows/CI.yaml) [![Test coverage](https://coveralls.io/repos/qunitjs/qunit/badge.svg)](https://coveralls.io/github/qunitjs/qunit) -[![Chat on Matrix](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/qunitjs/qunit) +[![Chat on Matrix](https://badges.gitter.im/Join%20Chat.svg)](https://app.element.io/#/room/#qunitjs_qunit:gitter.im) [![npm](https://img.shields.io/npm/v/qunit.svg?style=flat)](https://www.npmjs.com/package/qunit) [![Reproducible build status](https://img.shields.io/badge/Reproducible_Builds-ok-success?labelColor=1e5b96)](https://github.com/qunitjs/qunit/actions/workflows/reproducible.yaml) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/5751/badge)](https://www.bestpractices.dev/projects/5751) @@ -25,7 +25,7 @@ project and has since evolved to test any client-side or server-side JavaScript To report a bug or request a new feature, [open an issue](https://github.com/qunitjs/qunit/issues). -If you need help using QUnit, chat with us on [Matrix](https://gitter.im/qunitjs/qunit). +If you need help using QUnit, chat with us on [Matrix](https://app.element.io/#/room/#qunitjs_qunit:gitter.im). ## Contribute diff --git a/docs/Gemfile b/docs/Gemfile index 9cef3e983..831882841 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" ruby RUBY_VERSION # To apply changes, run `bundle update`. -gem "jekyll-theme-amethyst", "1.0.3", group: :jekyll_plugins +gem "jekyll-theme-amethyst", "1.1.0", group: :jekyll_plugins diff --git a/docs/_config.yml b/docs/_config.yml index d6d2672e3..50dc3c1dd 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -46,7 +46,7 @@ amethyst: mastodon: https://fosstodon.org/@qunit twitter: qunitjs github: qunitjs - gitter: qunitjs/qunit + chat: https://app.element.io/#/room/#qunitjs_qunit:gitter.im # https://github.com/qunitjs/jekyll-theme-amethyst/blob/main/docs/getting-started.md#enable-typesense typesense: origin: https://typesense.jquery.com diff --git a/docs/api/QUnit/test.md b/docs/api/QUnit/test.md index 1275b75f5..fb88a70e1 100644 --- a/docs/api/QUnit/test.md +++ b/docs/api/QUnit/test.md @@ -76,6 +76,7 @@ QUnit.test('Test with async-await', async assert => { }); ``` +Check out the [Step API](../assert/verifySteps.md) as well. If your async test involves capturing values from an event or async callback, then adopting the `assert.step()` allows for clean test code, that is robust and strict against false positives. ### Example: Test with Promise diff --git a/docs/api/assert/rejects.md b/docs/api/assert/rejects.md index 2c16c0439..d175f86f0 100644 --- a/docs/api/assert/rejects.md +++ b/docs/api/assert/rejects.md @@ -4,6 +4,7 @@ title: assert.rejects() excerpt: Test if the provided promise rejects. groups: - assert + - async redirect_from: - "/assert/rejects/" version_added: "2.5.0" diff --git a/docs/intro.md b/docs/intro.md index 706d9fe77..18fe90274 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -7,12 +7,6 @@ redirect_from: - "/guides/" --- -

- -Up-and-running with QUnit [in Node.js](./cli.md) or [in the browser](./browser.md). - -

- ## In Node.js [Getting Started in Node.js](./cli.md) @@ -21,6 +15,24 @@ Up-and-running with QUnit [in Node.js](./cli.md) or [in the browser](./browser.m [Getting Started in the browser](./browser.md) +## Guides + +Check these QUnit tutorials and examples, to make the most of your unit tests! + +1. [QUnit.module](./api/QUnit/module.md#organizing-your-tests): How to group related tests. +1. [QUnit.test](./api/QUnit/test.md#examples): Define tests, How to wait for async code +1. [Fixture feature](./browser.md#fixture): Keeping your DOM tests atomic. +1. [Step API](./api/assert/verifySteps.md): Testing asynchronous callbacks or event listeners. +1. [Assertions](./api/assert/index.md): Partial object comparison, expected exceptions, and much more. +1. [Browser](./browser.md): Productivity tricks, Browser automation, What can the toolbar do? +1. [CLI](./cli.md): Productivity tricks, Code coverage. + +## Support + +To report a bug or request a new feature, [open an issue](https://github.com/qunitjs/qunit/issues). + +If you need help using QUnit, join us in the [Matrix chat](https://app.element.io/#/room/#qunitjs_qunit:gitter.im)! + --- ## Linting