Skip to content

Commit 5bdbb74

Browse files
authored
Merge pull request #27 from testcafe-community/next
Tag v1.2.6 to `@latest`
2 parents 3726612 + a78bd05 commit 5bdbb74

34 files changed

+60864
-27287
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ module.exports = {
4545
"import/no-extraneous-dependencies": [
4646
"error",
4747
{ devDependencies: true }
48-
]
48+
],
49+
"no-console": "off",
50+
"@typescript-eslint/no-non-null-assertion": "off" // Tests should throw errors, jest will catch them
4951
}
5052
},
5153
{

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ node_modules
44
coverage
55
dist
66
yarn.lock
7+
8+
__cache__

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<img src="https://img.shields.io/npm/dependency-version/eslint-plugin-testcafe-community/peer/eslint">
2424
<img src="https://img.shields.io/node/v-lts/eslint-plugin-testcafe-community?color=blue">
2525
<img src="https://badgen.net/badge/icon/Typescript?icon=typescript&label">
26-
<img src="https://img.shields.io/github/last-commit/testcafe-community/eslint-plugin-testcafe-community">
26+
<img src="https://img.shields.io/github/last-commit/testcafe-community/eslint-plugin-testcafe-community/next">
2727
</p>
2828
<p align="center">
2929
<img src="https://img.shields.io/badge/Contributors-PR's_welcome-pink">
@@ -66,6 +66,10 @@ file:
6666
}
6767
```
6868

69+
You may review our
70+
[example TS/JS package](https://github.com/testcafe-community/eslint-plugin-testcafe-community/tree/master/example)
71+
embedded in this repository for an example configuration and plugin testing.
72+
6973
See
7074
[ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
7175
for more information about extending configuration files.

example/.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

example/.eslintrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"extends": [
8+
"eslint:recommended"
9+
],
10+
"overrides": [
11+
{
12+
"files": ["*.ts"],
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaVersion": 12,
16+
"sourceType": "module",
17+
"project": "tsconfig.eslint.json"
18+
},
19+
"extends": "plugin:@typescript-eslint/recommended",
20+
"plugins": ["@typescript-eslint"]
21+
},
22+
{
23+
"files": ["*.test.{ts,js}"],
24+
"extends": ["plugin:testcafe-community/recommended"],
25+
"plugins": ["testcafe-community"]
26+
}
27+
],
28+
"rules": {}
29+
}

example/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Example Package
2+
3+
This folder is a barebones webpage that has TestCafe journey tests for
4+
validation. This package represents the ESLint configuration
5+
[.eslintrc.json](./.eslintrc.json) needed to import the
6+
`eslint-plugin-testcafe-community` plugin and evaluate a file.
7+
8+
The journey test is expected to have at least one example of all invalid
9+
configurations to exemplify how the `testcafe-community` plugin will identify
10+
the poor programming patterns in TestCafe test suites.
11+
12+
## Integration
13+
14+
See [`example.serial-test.ts`](../tests/example.serial-test.ts) for the higher
15+
level integration test which relies upon this example package configuration. The
16+
`jest` test runner will evaluate the validity of the testcafe-community plugin's
17+
integration with ESLint and its effectiveness.

example/example.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
import path from "path";
3+
import { ClientFunction, Selector } from "testcafe";
4+
5+
const getBrowserURL = ClientFunction(() => document.location.href);
6+
7+
fixture("MyHTMLPage")
8+
.page(`file://${path.join(__dirname, "src", "index.html")}`);
9+
10+
// Lint Error: noOnly, noIdenticalTitle
11+
test.only("Page loads and displays hello world", async (t: TestController) => {
12+
await t.expect(getBrowserURL()).match(/file:\/\/.+\/src\/index.html/);
13+
await t.expect(Selector("p").withText("Hello World")).ok();
14+
});
15+
16+
// Lint Error: noSkip, noIdenticalTitle, expectExpect
17+
test.skip("Page loads and displays hello world", async (t: TestController) => {
18+
// Lint Error: noDebug
19+
t.debug()
20+
})

example/fake.test.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)