Skip to content

Commit

Permalink
(refactor): move manual tests into integration test dir
Browse files Browse the repository at this point in the history
- move build-withConfig into integration-tests/fixtures/
  - move its package.json deps into root devDeps
    - it's much easier to work with this way vs. as subdirectories
      with separate package.json and node_modules
      - and consistent with how the E2E tests work too
    - (deps): remove eslint-config-postcss as it wasn't used anyway

- move fixtures/ to test/fixtures as they're specific to E2E tests

- move test/jest.config.json to root jest.config.js
  - so it's used by default, no need for --config
- significantly simplify jest.config.js now that it's in root too
  - and the simplification allows it to be used for both test dirs

(docs): update fixtures README to remove "manual" references
(docs): reword all mentions of tests to say E2E tests
- that's what they currently are, though I'd like to refactor many to
  be unit tests
(docs): add tests README and integration test fixtures README
  • Loading branch information
agilgur5 committed Mar 27, 2020
1 parent d234dff commit a43da8d
Show file tree
Hide file tree
Showing 40 changed files with 1,064 additions and 1,412 deletions.
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
testEnvironment: 'node',
testMatch: [
'<rootDir>/**/*(*.)@(test).[tj]s?(x)'
],
testPathIgnorePatterns: [
'/node_modules/', // default
'<rootDir>/templates/' // don't run tests in the templates
]
}
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint": "yarn build && yarn lint:post-build",
"lint:post-build": "node dist/index.js lint src test --ignore-pattern 'test/tests/lint'",
"test": "yarn build && yarn test:post-build",
"test:post-build": "node dist/index.js test --config ./test/jest.config.json",
"test:post-build": "node dist/index.js test",
"start": "tsc -p tsconfig.json --watch",
"release": "np"
},
Expand Down Expand Up @@ -112,13 +112,18 @@
"@types/rollup-plugin-sourcemaps": "^0.4.2",
"@types/sade": "^1.6.0",
"@types/semver": "^7.1.0",
"autoprefixer": "^9.7.4",
"cssnano": "^4.1.10",
"doctoc": "^1.4.0",
"husky": "^4.2.2",
"np": "^6.2.0",
"pretty-quick": "^2.0.0",
"ps-tree": "^1.2.0",
"react": "^16.8.6",
"semver": "^7.1.1"
"rollup-plugin-postcss": "^2.5.0",
"semver": "^7.1.1",
"tiny-invariant": "^1.1.0",
"tiny-warning": "^1.0.3"
},
"husky": {
"hooks": {
Expand Down
6 changes: 6 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Tests

There are two main directories here:

- `tests` contains end-to-end (E2E) tests of the CLI
- `integration-tests` contains tests ensuring that common or recommended plugins work properly together with TSDX
17 changes: 0 additions & 17 deletions test/fixtures/build-withConfig/package.json

This file was deleted.

Loading

0 comments on commit a43da8d

Please sign in to comment.