Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
Use 'title/' permalink and add /cookbook/ redirect
Browse files Browse the repository at this point in the history
* Add redirect for the <https://qunitjs.com/cookbook/> page
  we have on the old site to the new /intro page.

* Use /:title/ instead of /:title for the permalinks so that it
  matches the old site for compatibility.

* Use HTTPS for links where possible.

Ref qunitjs/qunitjs.com#151.
  • Loading branch information
Krinkle committed Jul 5, 2020
1 parent 3ecdae4 commit b68ed2d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 27 deletions.
36 changes: 21 additions & 15 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
# This config file is meant for settings that affect your whole site.
# These values are expected to rarely change. If you are editing this file
# very often, consider using Jekyll's data files feature.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.

# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
## Site settings
## https://jekyllrb.com/docs/configuration/

title: QUnit
# email: your-email@domain.com
description: > # this means to ignore newlines until "baseurl:"
The powerful, easy-to-use JavaScript testing framework
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://qunitjs.com" # the base hostname & protocol for your site, e.g. http://example.com
description: The powerful, easy-to-use JavaScript testing framework
# the base hostname and protocol for your site
url: "https://qunitjs.com"
# the subpath of your site, e.g. /blog
baseurl: ""

plugins:
# https://help.github.com/articles/redirects-on-github-pages/
- jekyll-redirect-from

# Theme
twitter_username: qunitjs
github_username: qunitjs

# Conversion
highlighter: rouge
markdown: kramdown
kramdown:
Expand All @@ -33,6 +37,7 @@ algolia: # Search
index_name: qunitjs
search_only_api_key: aed00982db05bd21dd05310be057bda8

# Input files
exclude:
- Gemfile
- Gemfile.lock
Expand All @@ -41,4 +46,5 @@ exclude:
- CNAME
- vendor

permalink: title
# Output
permalink: title/
2 changes: 2 additions & 0 deletions intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: page
title: Getting Started
redirect_from:
- "/cookbook/"
---

<p class="lead" markdown="1">The following guide will get you up-and-running with QUnit in either [Node](#in-node) or [the Browser](#in-the-browser) in just a few minutes.</p>
Expand Down
24 changes: 12 additions & 12 deletions upgrade-guide-2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ QUnit 2.0.x will include a migration layer that throws descriptive errors for al

## Removed globals

QUnit no longer exposes multiple global variables. The only global variable still exposed is `QUnit`. Use [`QUnit.module()`](http://api.qunitjs.com/QUnit.module/) and [`QUnit.test()`](http://api.qunitjs.com/QUnit.test/) to define your test suite, and use the [`assert`](http://api.qunitjs.com/QUnit.assert/) argument in test callbacks to write assertions.
QUnit no longer exposes multiple global variables. The only global variable still exposed is `QUnit`. Use [`QUnit.module()`](https://api.qunitjs.com/QUnit.module/) and [`QUnit.test()`](https://api.qunitjs.com/QUnit.test/) to define your test suite, and use the [`assert`](https://api.qunitjs.com/QUnit.assert/) argument in test callbacks to write assertions.

The global `stop()` and `start()` methods are gone, replaced by [`assert.async()`](http://api.qunitjs.com/async/), which returns a callback. Execute this callback when your test is done.
The global `stop()` and `start()` methods are gone, replaced by [`assert.async()`](https://api.qunitjs.com/async/), which returns a callback. Execute this callback when your test is done.

### Replace `module()` with `QUnit.module()`

The global function `module()` is gone. Use [`QUnit.module()`](http://api.qunitjs.com/QUnit.module/) instead.
The global function `module()` is gone. Use [`QUnit.module()`](https://api.qunitjs.com/QUnit.module/) instead.

Before:

Expand All @@ -37,7 +37,7 @@ QUnit.module( "router" );

### Replace `test()` with `QUnit.test()`

The global function `test()` is gone. Use [`QUnit.test()`](http://api.qunitjs.com/QUnit.test/) instead.
The global function `test()` is gone. Use [`QUnit.test()`](https://api.qunitjs.com/QUnit.test/) instead.

Before:

Expand All @@ -53,7 +53,7 @@ QUnit.test( "defaults to home" );

### Replace `stop()` and `start()` with `assert.async()`

The global functions `stop()` and `start()` are gone. Use [`assert.async()`](http://api.qunitjs.com/async/) instead, which returns a "done" function that should be called when the asynchronous operation has completed.
The global functions `stop()` and `start()` are gone. Use [`assert.async()`](https://api.qunitjs.com/async/) instead, which returns a "done" function that should be called when the asynchronous operation has completed.

Before:

Expand Down Expand Up @@ -81,7 +81,7 @@ QUnit.test( "navigates to new page (async)", function( assert ) {

### Replace `asyncTest()` with `QUnit.test()` and `assert.async()`

The global function `asyncTest()` is gone. Use [`QUnit.test()`](http://api.qunitjs.com/QUnit.test/) and [`assert.async()`](http://api.qunitjs.com/async/) instead.
The global function `asyncTest()` is gone. Use [`QUnit.test()`](https://api.qunitjs.com/QUnit.test/) and [`assert.async()`](https://api.qunitjs.com/async/) instead.

Before:

Expand All @@ -108,7 +108,7 @@ QUnit.test( "navigates to new page (async)", function( assert ) {

### Replace `expect()` with `assert.expect()`

The global function `expect()` is gone. Use [`assert.expect()`](http://api.qunitjs.com/expect/) instead.
The global function `expect()` is gone. Use [`assert.expect()`](https://api.qunitjs.com/expect/) instead.

Before:

Expand All @@ -134,9 +134,9 @@ QUnit.test( "refresh (sync)", function( assert ) {

### Replace global assertions with `assert` arguments

All global assertions, like `equal()` and `deepEqual()` are gone. Use `assert` instead, like [`assert.equal()`](http://api.qunitjs.com/equal/) or [`assert.deepEqual()`](http://api.qunitjs.com/deepEqual/).
All global assertions, like `equal()` and `deepEqual()` are gone. Use `assert` instead, like [`assert.equal()`](https://api.qunitjs.com/equal/) or [`assert.deepEqual()`](https://api.qunitjs.com/deepEqual/).

Here are all assertion methods affected by this change in alphabetic order: [`deepEqual()`](http://api.qunitjs.com/deepEqual/), [`equal()`](http://api.qunitjs.com/equal/), [`notDeepEqual()`](http://api.qunitjs.com/notDeepEqual/), [`notEqual()`](http://api.qunitjs.com/notEqual/), [`notPropEqual()`](http://api.qunitjs.com/notPropEqual/), [`notStrictEqual()`](http://api.qunitjs.com/notStrictEqual/), [`ok()`](http://api.qunitjs.com/ok/), [`propEqual()`](http://api.qunitjs.com/propEqual/), [`strictEqual()`](http://api.qunitjs.com/strictEqual/), and [`throws()`](http://api.qunitjs.com/throws/).
Here are all assertion methods affected by this change in alphabetic order: [`deepEqual()`](https://api.qunitjs.com/deepEqual/), [`equal()`](https://api.qunitjs.com/equal/), [`notDeepEqual()`](https://api.qunitjs.com/notDeepEqual/), [`notEqual()`](https://api.qunitjs.com/notEqual/), [`notPropEqual()`](https://api.qunitjs.com/notPropEqual/), [`notStrictEqual()`](https://api.qunitjs.com/notStrictEqual/), [`ok()`](https://api.qunitjs.com/ok/), [`propEqual()`](https://api.qunitjs.com/propEqual/), [`strictEqual()`](https://api.qunitjs.com/strictEqual/), and [`throws()`](https://api.qunitjs.com/throws/).

Before:

Expand Down Expand Up @@ -167,7 +167,7 @@ QUnit.test( "static properties", function( assert ) {

## Rename module hooks

The [module hooks](http://api.qunitjs.com/QUnit.module/) `setup` and `teardown` have been renamed to `beforeEach` and `afterEach`, to make it more obvious that they run for each test within a module.
The [module hooks](https://api.qunitjs.com/QUnit.module/) `setup` and `teardown` have been renamed to `beforeEach` and `afterEach`, to make it more obvious that they run for each test within a module.

Before:

Expand Down Expand Up @@ -203,7 +203,7 @@ A few methods and properties in the `QUnit` namespace have been modified or remo

For several versions of QUnit before 2.0, custom reporters could be registered by calling the appropriate methods with a callback function. If your code still uses the old approach of overwriting a property on the `QUnit` object, replace that by calling the method instead.

This applies to all reporting callbacks, specifically: [`begin`](http://api.qunitjs.com/QUnit.begin/), [`done`](http://api.qunitjs.com/QUnit.done/), [`log`](http://api.qunitjs.com/QUnit.log/), [`moduleDone`](http://api.qunitjs.com/QUnit.moduleDone/), [`moduleStart`](http://api.qunitjs.com/QUnit.moduleStart/), [`testDone`](http://api.qunitjs.com/QUnit.testDone/), and [`testStart`](http://api.qunitjs.com/QUnit.testStart/).
This applies to all reporting callbacks, specifically: [`begin`](https://api.qunitjs.com/QUnit.begin/), [`done`](https://api.qunitjs.com/QUnit.done/), [`log`](https://api.qunitjs.com/QUnit.log/), [`moduleDone`](https://api.qunitjs.com/QUnit.moduleDone/), [`moduleStart`](https://api.qunitjs.com/QUnit.moduleStart/), [`testDone`](https://api.qunitjs.com/QUnit.testDone/), and [`testStart`](https://api.qunitjs.com/QUnit.testStart/).

Before:

Expand Down Expand Up @@ -283,7 +283,7 @@ QUnit.test( "refresh, after replaceState", function( assert ) {

### Replace `QUnit.jsDump` with `QUnit.dump`

Originally `jsDump` was a standalone library imported into QUnit. It has since evolved further within the library. To reflect that, the property was renamed to [`QUnit.dump.parse`](http://api.qunitjs.com/QUnit.dump.parse/). This should only affect custom reporter code, not regular testsuites.
Originally `jsDump` was a standalone library imported into QUnit. It has since evolved further within the library. To reflect that, the property was renamed to [`QUnit.dump.parse`](https://api.qunitjs.com/QUnit.dump.parse/). This should only affect custom reporter code, not regular testsuites.

Before:

Expand Down

0 comments on commit b68ed2d

Please sign in to comment.