Skip to content

Removed end-to-end tests #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

- run: npm run prettier

test-end-to-end:
test:
docker:
- image: circleci/node:latest

Expand All @@ -91,21 +91,7 @@ jobs:
- attach_workspace:
at: "."

- run: npm run test:end-to-end

test-unit:
docker:
- image: circleci/node:latest

working_directory: ~/repo

steps:
- checkout

- attach_workspace:
at: "."

- run: npm run test:unit -- --coverage
- run: npm run test -- --coverage

tsc:
docker:
Expand Down Expand Up @@ -143,11 +129,7 @@ workflows:
- prettier:
requires:
- build
- test-end-to-end:
requires:
- build
- tsc
- test-unit:
- test:
requires:
- build
- tsc:
Expand Down
4 changes: 2 additions & 2 deletions docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ cd tslint-to-eslint-config
npm i
```

Compile with `npm run tsc` and run tests with `npm run test:unit`.
Compile with `npm run tsc` and run tests with `npm run test`.

## Further Reading

- [Architecture](./Architecture.md): How the general app structure operates
- [Dependencies](./Dependencies.md): How functions pass and receive static dependencies
- [Testing](./Testing.md): Unit and end-to-end tests
- [Testing](./Testing.md): Unit tests
27 changes: 1 addition & 26 deletions docs/Testing.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Testing

## Unit Tests

```
npm run test:unit
npm run test
```

Each `src/**/*.ts` source file should have an equivalent `*.test.ts` next to it.
Expand All @@ -21,26 +19,3 @@ Tests should include comments above each section of the "AAA" testing format:

See [Dependencies](./Dependencies.md) for how static dependencies are stubbed out in functions.
That system is how functions can receive stubs and spies during unit tests.

## End-to-End Tests

```shell
npm run test:end-to-end
```

End-to-end tests that execute the `bin/tslint-to-eslint` command and validate outputs are generated from the directories in `test/tests/`.
Each directory there contains:

- `test.ts`: Test file that runs `createTests(__dirname);` to set up tests in that directory
- `.eslintrc.json`: `.gitignore`d output from the most recent test run
- `expected.json`: Expected output ESLint configuration
- `stderr.txt`: Expected output written to the process `stderr`
- `stdout.txt`: Expected output written to the process `stdout`
- `tslint.json`: Original TSLint configuration file to convert

Within each directory, a test suite will execute `bin/tslint-to-eslint` and validate the outputs match what's on disk.

Use `npm run test:end-to-end:accept` to overwrite the expected contents of files with what is actually written.
These behave similarly to updating snapshots in snapshot testing.

> Note: these end-to-end tests use the compiled result of `npm run tsc`, so if you update source code, re-run `npm run tsc` before `npm run test:end-to-end`.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
"eslint": "eslint \"./src/*.ts\" \"./src/**/*.ts\" --report-unused-disable-directives",
"prettier": "prettier \"./src/*.{js,json,ts,xml,yaml}\" \"./src/**/*.{js,json,ts,xml,yaml}\" --ignore-path .prettierignore",
"prettier:write": "npm run prettier -- --write",
"test:unit": "jest",
"test:end-to-end": "jest --config=test/jest.config.js --runInBand",
"test:end-to-end:accept": "jest --config=test/jest.config.js --globals=\"{\\\"acceptTestChanges\\\": true }\" --runInBand",
"test": "jest",
"tsc": "tsc"
},
"version": "0.2.7"
Expand Down
16 changes: 0 additions & 16 deletions test/createTestArgs.ts

This file was deleted.

78 changes: 0 additions & 78 deletions test/createTests.ts

This file was deleted.

25 changes: 0 additions & 25 deletions test/expectFileContains.ts

This file was deleted.

5 changes: 0 additions & 5 deletions test/jest.config.js

This file was deleted.

84 changes: 0 additions & 84 deletions test/tests/custom eslint path/eslintrc.js

This file was deleted.

Loading