Skip to content

Commit

Permalink
Merge pull request #37 from sparksuite/refactor-testing
Browse files Browse the repository at this point in the history
Refactor testing to be based around real-world programs
  • Loading branch information
WesCossick authored Feb 25, 2021
2 parents 1803982 + 7579806 commit ef981a3
Show file tree
Hide file tree
Showing 32 changed files with 9,506 additions and 5,906 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn dev
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn test
- name: Codecov
uses: codecov/codecov-action@v1
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ You should not call the validator more often than **1 req/sec**. From W3C’s [m
## Local development

To prep a just-cloned or just-cleaned repository for local development, run `yarn dev`.

To test the whole project, run `yarn test`.

To format the code, run `yarn format`.
Expand Down
4 changes: 1 addition & 3 deletions .eslintrc.json → eslint.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"env": {
Expand All @@ -17,8 +16,7 @@
"sourceType": "module",
"ecmaFeatures": {
"modules": true
},
"project": ["./tsconfig.json", "./tsconfig.eslint.json"]
}
},
"plugins": ["@typescript-eslint"],
"rules": {
Expand Down
6 changes: 6 additions & 0 deletions eslint.src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["./eslint.base.json", "plugin:@typescript-eslint/recommended-requiring-type-checking"],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
3 changes: 3 additions & 0 deletions eslint.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["./eslint.base.json"]
}
25 changes: 0 additions & 25 deletions jest.config.ts

This file was deleted.

15 changes: 3 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"dist/"
],
"scripts": {
"dev": "yarn --frozen-lockfile --check-files && yarn compile && yarn link && cd test/puppeteer && yarn --frozen-lockfile --check-files && yarn link \"w3c-css-validator\" && npx webpack",
"test": "jest",
"lint": "eslint --ext .js,.ts . && prettier --check '**/*.{ts,js,json,yml}'",
"format": "eslint --fix --ext .js,.ts . && prettier --write '**/*.{ts,js,json,yml}'",
"test": "yarn compile && for directory in ./tests/*/ ; do (yarn --cwd \"$directory\" test); done",
"lint": "eslint --config ./eslint.src.json --ext .js,.ts ./src && eslint --config ./eslint.tests.json --ext .js,.ts ./tests && prettier --check '**/*.{ts,js,json,yml}'",
"format": "eslint --config ./eslint.src.json --fix --ext .js,.ts ./src && eslint --config ./eslint.tests.json --ext .js,.ts ./tests && prettier --write '**/*.{ts,js,json,yml}'",
"clean": "git clean -X -d --force && find . -type d -empty -delete",
"precompile": "rm -rf dist/",
"compile": "tsc --project tsconfig.build.json"
Expand All @@ -34,20 +33,12 @@
"homepage": "https://github.com/sparksuite/w3c-css-validator",
"dependencies": {},
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/jest-environment-puppeteer": "^4.4.1",
"@types/node": "^14.14.25",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"eslint": "^7.19.0",
"eslint-config-prettier": "^8.0.0",
"jest": "^26.6.3",
"jest-puppeteer": "^4.4.0",
"merge": "^2.1.1",
"prettier": "^2.2.1",
"puppeteer": "^7.1.0",
"ts-jest": "^26.5.2",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
}
}
11 changes: 0 additions & 11 deletions test/puppeteer/package.json

This file was deleted.

21 changes: 0 additions & 21 deletions test/puppeteer/tsconfig.json

This file was deleted.

Loading

0 comments on commit ef981a3

Please sign in to comment.