-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update docs & generation script (#21)
* build(deps): bump ini from 1.3.5 to 1.3.7 (#8) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](npm/ini@v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix-readme > Re-implement table generation script * docs/rules > Add missing docs for rules & contributors entry * fix-readme > Resolve & Update table generation * docs > add a readme for expect-expect rule * docs > add a readme for no-identical-title rule * docs > Fix codeblock to match testcafe syntax * build(deps): bump y18n from 4.0.0 to 4.0.1 (#9) * build(deps): bump handlebars from 4.7.6 to 4.7.7 (#10) * build(deps): bump lodash from 4.17.19 to 4.17.21 (#11) * build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 (#12) * build(deps): bump lodash from 4.17.20 to 4.17.21 in /example (#13) * build(deps): bump normalize-url from 5.3.0 to 5.3.1 (#15) * build(deps): bump trim-newlines from 3.0.0 to 3.0.1 (#16) * build(deps): bump glob-parent from 5.1.1 to 5.1.2 (#17) * build(deps): bump glob-parent from 5.1.1 to 5.1.2 in /example (#18) * build(deps): bump path-parse from 1.0.6 to 1.0.7 (#19) * build(deps): bump tmpl from 1.0.4 to 1.0.5 (#20) * build(deps): bump ws from 7.2.5 to 7.5.5 (#25) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9774193
commit 1dedf5a
Showing
7 changed files
with
875 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# All tests should have at least one assertion via t.expect(). (expect-expect) | ||
|
||
## Rule Details | ||
|
||
This rule aims to ensure a `t.expect()` function call exists within a defined test block. There maybe times in local development you don't have an assertion defined, but this rule aims to prevent a test case from being accidentally committed and falsfully report a pass when it doesn't test any condition. | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
// Example 1: Forgot to add an assertion but provided an action | ||
test('should do stuff', async (t) => { | ||
await t.click(Selector("foo")) | ||
}) | ||
|
||
// Example 2: empty test scaffolding | ||
test('test something', (t) => { | ||
// TODO: Test something | ||
}) | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
test('should change text to clicked', async (t) => { | ||
const text = Selector("bar") | ||
await t.click(Selector("foo")) | ||
await t.expect(text).toEqual("button clicked") // Makes an assertion | ||
}) | ||
``` | ||
|
||
## When Not To Use It | ||
|
||
If you don't care if people add empty test cases to your source code repository. | ||
|
||
## Further Reading | ||
|
||
<https://testcafe.io/documentation/402837/guides/basic-guides/assert> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Don't allow an identical test title to be committed to the repository. (no-identical-title) | ||
|
||
## Rule Details | ||
|
||
This rule aims to prevent duplicate test names to exist. All tests should have an unique name across the entire repository. | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
test("should see a button to click", async (t) => { | ||
await t.expect(Selector("foo").value).toEqual("Click Me!") | ||
}) | ||
|
||
// Duplicate title | ||
test("should see a button to click", async (t) => { | ||
await t.click(Selector("foo")) | ||
await t.expect(Selector("foo").value).toEqual("Clicked") | ||
}) | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
// 2 different titles | ||
test("should see a button to click", async (t) => { | ||
await t.expect(Selector("foo").value).toEqual("Click Me!") | ||
}) | ||
test("should see button text change after clicked", async (t) => { | ||
await t.click(Selector("foo")) | ||
await t.expect(Selector("foo").value).toEqual("Clicked") | ||
}) | ||
``` | ||
|
||
## When Not To Use It | ||
|
||
If you don't care if people add tests with the same name to your source code repository. | ||
|
||
## Further Reading | ||
|
||
<https://testcafe.io/documentation/402831/guides/basic-guides/organize-tests#tests> |
Oops, something went wrong.