-
Notifications
You must be signed in to change notification settings - Fork 450
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
[wip][beta] doc updates & CI filtering fixes #701
Conversation
a67d0a1
to
53b8f7a
Compare
e65eb74
to
2bf6b5f
Compare
docs/user/config.md
Outdated
|
||
## Jest preset | ||
|
||
### Basic usage | ||
|
||
In most of the case, simply adding `preset: 'ts-jest'` to your Jest config should be enough starting using TypeScript with Jest (suposing you did add `ts-jest` to your dev. npm dependencies of course): | ||
In most of the case, simply adding `preset: 'ts-jest'` to your Jest config should be enough starting using TypeScript with Jest (supposing you did add `ts-jest` to your dev. npm dependencies of course): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In most cases, simply adding
preset: 'ts-jest'
to your Jest config should be enough to start using TypeScript with Jest (assuming you have addedts-jest
to your dependencies of course):
docs/user/config.md
Outdated
@@ -50,10 +50,79 @@ module.exports = { | |||
} | |||
``` | |||
|
|||
## Paths mapping | |||
|
|||
If you use ["baseUrl" asn "paths" options](https://www.typescriptlang.org/docs/handbook/module-resolution.html) in your `tsconfig` file, you should make sure the ["moduleNameMapper"](https://facebook.github.io/jest/docs/en/configuration.html#modulenamemapper-object-string-string) option in your Jest config is setup accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"baseUrl" and "paths" options
docs/user/config/isolatedModules.md
Outdated
@@ -2,7 +2,7 @@ | |||
title: Isolated Modules option | |||
--- | |||
|
|||
By default TSJest uses TypeScript compiler in the context of a project (yours), with full type-checking and features. But it can also be used to compile each file separatly, as an isolated module. That's what the `isolatedModules` option (which defaults to `false`) comes for. | |||
By default TSJest uses TypeScript compiler in the context of a project (yours), with full type-checking and features. But it can also be used to compile each file separately, as an isolated module. That's what the `isolatedModules` option (which defaults to `false`) comes for. | |||
|
|||
You'll loose type-checking ability and some features such as `const enum`, but in the case you plan on using Jest with the cache disabled (`jest --no-cache`), your tests will then run much faster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loose
-> lose
docs/user/config/tsConfig.md
Outdated
@@ -4,15 +4,15 @@ title: TypeScript Config option | |||
|
|||
The `tsConfig` option allows you to define the which `tsconfig` JSON file to use. An inline compiler options object can also be specified instead of the path to a file. | |||
|
|||
By default, TSJest will do like `tsc` and use the project's `tsconfig.json` file. If it cannot find one, it'l use defaults TypeScript compiler options (except `es5` is used as target instead of `es3`). | |||
By default, TSJest will do like `tsc` and use the project's `tsconfig.json` file. If it cannot find one, it'll use defaults TypeScript compiler options (except `es5` is used as target instead of `es3`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TSJest will behave like
tsc
...
it'll use the default TypeScript ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm...
By default, it'll use the default TypeScript
not too many "default"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, one is for the 'situation' and one is for the compiler options so it seems ok
doc: minor updates to the config docs
docs/user/config/diagnostics.md
Outdated
|
||
### Disabling/enabling | ||
|
||
By default all diagnostic are enabled. This is the same as setting the `diagnostics` option to `true`. To disable all diagnostics, set `diagnostics` to `false` (you might experience slightly better performence as well, especially if you disabled Jest cache). | ||
By default all diagnostic are enabled. This is the same as setting the `diagnostics` option to `true`. To disable all diagnostics, set `diagnostics` to `false` (you might experience slightly better performance as well, especially if you disabled Jest cache). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diagnostic -> diagnostics
docs/user/config/diagnostics.md
Outdated
|
||
### Advanced configuration | ||
|
||
The option's value can also accpet an object for more advanced configuration. Each config. key is optional: | ||
The option's value can also accept an object for more advanced configuration. Each config. key is optional: | ||
|
||
- **`pretty`**: Enables/disable colorful and pretty output of errors (default: _enabled_). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enables/disable -> Enables/disables
docs/user/config/index.md
Outdated
--- | ||
title: Configuration | ||
--- | ||
TSJest configuration is done within Jest configuration object. This configuration can be in `package.json` under the `jest` property, or in its own `jest.config.js` file. The latter is preferred since it's a JavaScript file, but it depends on your needs and preference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter is preferred -> the 2nd option is preferred (it looks clearer).
Suggestions by @ahnpnl and @kulshekhar
docs: Updated documentation
No description provided.