@commercetools-frontend/jest-preset-mc-app 21.6.0 → 21.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +13 -7
- package/jest-preset-for-typescript.js +2 -7
- package/package.json +1 -1
- package/typescript/index.js +1 -0
- package/typescript/jest-preset.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @commercetools-frontend/jest-preset-mc-app
|
|
2
2
|
|
|
3
|
+
## 21.7.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2627](https://github.com/commercetools/merchant-center-application-kit/pull/2627) [`5a8c301d`](https://github.com/commercetools/merchant-center-application-kit/commit/5a8c301d5627df1e8bb6dcf8870575c6ca32c0a7) Thanks [@emmenko](https://github.com/emmenko)! - Add proper entry point for Jest preset for `typescript`.
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
-const jestPresetForTypeScript = require('@commercetools-frontend/jest-preset-mc-app/jest-preset-for-typescript');
|
|
11
|
+
|
|
12
|
+
module.exports = {
|
|
13
|
+
- ...jestPresetForTypeScript,
|
|
14
|
+
+ preset: '@commercetools-frontend/jest-preset-mc-app/typescript'
|
|
15
|
+
};
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The import `@commercetools-frontend/jest-preset-mc-app/jest-preset-for-typescript` still works for backwards compatibility.
|
|
19
|
+
|
|
3
20
|
## 21.6.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<a href="https://www.npmjs.com/package/@commercetools-frontend/jest-preset-mc-app"><img src="https://badgen.net/npm/v/@commercetools-frontend/jest-preset-mc-app" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-frontend/jest-preset-mc-app"><img src="https://badgen.net/npm/v/@commercetools-frontend/jest-preset-mc-app/next" alt="Latest release (next dist-tag)" /></a> <a href="https://bundlephobia.com/result?p=@commercetools-frontend/jest-preset-mc-app"><img src="https://badgen.net/bundlephobia/minzip/@commercetools-frontend/jest-preset-mc-app" alt="Minified + GZipped size" /></a> <a href="https://github.com/commercetools/merchant-center-application-kit/blob/main/LICENSE"><img src="https://badgen.net/github/license/commercetools/merchant-center-application-kit" alt="GitHub license" /></a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
Jest preset used by a
|
|
7
|
+
Jest preset used by a Custom Application.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -12,6 +12,14 @@ Jest preset used by a MC application.
|
|
|
12
12
|
$ npm install --save @commercetools-frontend/jest-preset-mc-app
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
module.exports = {
|
|
19
|
+
preset: '@commercetools-frontend/jest-preset-mc-app',
|
|
20
|
+
};
|
|
21
|
+
```
|
|
22
|
+
|
|
15
23
|
## Custom config
|
|
16
24
|
|
|
17
25
|
You can pass a custom config using one of the [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) format options. The config module name to use is `jest-preset-mc-app`.
|
|
@@ -33,15 +41,13 @@ Supported options are:
|
|
|
33
41
|
|
|
34
42
|
## TypeScript support
|
|
35
43
|
|
|
36
|
-
If you need to use the Jest preset with additional TypeScript support, you need to
|
|
44
|
+
If you need to use the Jest preset with additional TypeScript support, you need to point to the `@commercetools-frontend/jest-preset-mc-app/typescript` preset in your Jest config.
|
|
37
45
|
|
|
38
46
|
For example:
|
|
39
47
|
|
|
40
48
|
```js
|
|
41
|
-
const jestPresetForTypeScript = require('@commercetools-frontend/jest-preset-mc-app/jest-preset-for-typescript');
|
|
42
|
-
|
|
43
49
|
module.exports = {
|
|
44
|
-
|
|
50
|
+
preset: '@commercetools-frontend/jest-preset-mc-app/typescript',
|
|
45
51
|
};
|
|
46
52
|
```
|
|
47
53
|
|
|
@@ -82,7 +88,7 @@ module.exports = {
|
|
|
82
88
|
};
|
|
83
89
|
```
|
|
84
90
|
|
|
85
|
-
Similarly, you can use the `@commercetools-frontend/jest-preset-mc-app/
|
|
91
|
+
Similarly, you can use the `@commercetools-frontend/jest-preset-mc-app/typescript` instead of the `@commercetools-frontend/jest-preset-mc-app`.
|
|
86
92
|
|
|
87
93
|
### Enzyme 17
|
|
88
94
|
|
|
@@ -117,4 +123,4 @@ module.exports = {
|
|
|
117
123
|
};
|
|
118
124
|
```
|
|
119
125
|
|
|
120
|
-
Similarly, you can use the `@commercetools-frontend/jest-preset-mc-app/
|
|
126
|
+
Similarly, you can use the `@commercetools-frontend/jest-preset-mc-app/typescript` instead of the `@commercetools-frontend/jest-preset-mc-app`.
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
...defaultPreset,
|
|
5
|
-
moduleFileExtensions: ['ts', 'tsx', ...defaultPreset.moduleFileExtensions],
|
|
6
|
-
testRegex: '\\.spec\\.[j|t]sx?$',
|
|
7
|
-
};
|
|
1
|
+
// Alias entry point, for backwards compatibility.
|
|
2
|
+
module.exports = require('./typescript');
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./jest-preset');
|