Skip to content

Commit

Permalink
Merge pull request testcafe-community#27 from testcafe-community/next
Browse files Browse the repository at this point in the history
Tag v1.2.6 to `@latest`
  • Loading branch information
codejedi365 authored Oct 23, 2021
2 parents 3726612 + a78bd05 commit 5bdbb74
Show file tree
Hide file tree
Showing 34 changed files with 60,864 additions and 27,287 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ module.exports = {
"import/no-extraneous-dependencies": [
"error",
{ devDependencies: true }
]
],
"no-console": "off",
"@typescript-eslint/no-non-null-assertion": "off" // Tests should throw errors, jest will catch them
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ node_modules
coverage
dist
yarn.lock

__cache__
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<img src="https://img.shields.io/npm/dependency-version/eslint-plugin-testcafe-community/peer/eslint">
<img src="https://img.shields.io/node/v-lts/eslint-plugin-testcafe-community?color=blue">
<img src="https://badgen.net/badge/icon/Typescript?icon=typescript&label">
<img src="https://img.shields.io/github/last-commit/testcafe-community/eslint-plugin-testcafe-community">
<img src="https://img.shields.io/github/last-commit/testcafe-community/eslint-plugin-testcafe-community/next">
</p>
<p align="center">
<img src="https://img.shields.io/badge/Contributors-PR's_welcome-pink">
Expand Down Expand Up @@ -66,6 +66,10 @@ file:
}
```

You may review our
[example TS/JS package](https://github.com/testcafe-community/eslint-plugin-testcafe-community/tree/master/example)
embedded in this repository for an example configuration and plugin testing.

See
[ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information about extending configuration files.
Expand Down
14 changes: 0 additions & 14 deletions example/.eslintrc.js

This file was deleted.

29 changes: 29 additions & 0 deletions example/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended"
],
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": "tsconfig.eslint.json"
},
"extends": "plugin:@typescript-eslint/recommended",
"plugins": ["@typescript-eslint"]
},
{
"files": ["*.test.{ts,js}"],
"extends": ["plugin:testcafe-community/recommended"],
"plugins": ["testcafe-community"]
}
],
"rules": {}
}
17 changes: 17 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Example Package

This folder is a barebones webpage that has TestCafe journey tests for
validation. This package represents the ESLint configuration
[.eslintrc.json](./.eslintrc.json) needed to import the
`eslint-plugin-testcafe-community` plugin and evaluate a file.

The journey test is expected to have at least one example of all invalid
configurations to exemplify how the `testcafe-community` plugin will identify
the poor programming patterns in TestCafe test suites.

## Integration

See [`example.serial-test.ts`](../tests/example.serial-test.ts) for the higher
level integration test which relies upon this example package configuration. The
`jest` test runner will evaluate the validity of the testcafe-community plugin's
integration with ESLint and its effectiveness.
20 changes: 20 additions & 0 deletions example/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

import path from "path";
import { ClientFunction, Selector } from "testcafe";

const getBrowserURL = ClientFunction(() => document.location.href);

fixture("MyHTMLPage")
.page(`file://${path.join(__dirname, "src", "index.html")}`);

// Lint Error: noOnly, noIdenticalTitle
test.only("Page loads and displays hello world", async (t: TestController) => {
await t.expect(getBrowserURL()).match(/file:\/\/.+\/src\/index.html/);
await t.expect(Selector("p").withText("Hello World")).ok();
});

// Lint Error: noSkip, noIdenticalTitle, expectExpect
test.skip("Page loads and displays hello world", async (t: TestController) => {
// Lint Error: noDebug
t.debug()
})
Empty file removed example/fake.test.ts
Empty file.
Loading

0 comments on commit 5bdbb74

Please sign in to comment.