@nx/react-native 16.10.0 → 17.0.0-beta.2
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/migrations.json +0 -972
- package/package.json +9 -9
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.d.ts +0 -8
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js +0 -57
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +0 -79
- package/src/migrations/update-12-5-0/update-jest-for-react-native.d.ts +0 -2
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js +0 -58
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.d.ts +0 -2
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +0 -18
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts +0 -48
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.d.ts +0 -6
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js +0 -36
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts +0 -61
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.d.ts +0 -6
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +0 -28
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +0 -192
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.d.ts +0 -5
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js +0 -33
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +0 -84
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.d.ts +0 -5
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js +0 -37
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +0 -48
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.d.ts +0 -6
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js +0 -28
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +0 -190
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.d.ts +0 -5
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js +0 -21
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts +0 -39
- package/src/migrations/update-14-5-8/change-searchDir-storybook.d.ts +0 -5
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js +0 -21
- package/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts +0 -39
- package/src/migrations/update-14-6-0/remove-jest-transform.d.ts +0 -5
- package/src/migrations/update-14-6-0/remove-jest-transform.js +0 -53
- package/src/migrations/update-14-6-0/remove-jest-transform.spec.ts +0 -109
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { addProjectConfiguration, readJson, Tree } from '@nx/devkit';
|
|
2
|
-
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
3
|
-
import update from './remove-jest-transform';
|
|
4
|
-
|
|
5
|
-
describe('Rename jest preprocessor', () => {
|
|
6
|
-
let tree: Tree;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
10
|
-
addProjectConfiguration(tree, 'products', {
|
|
11
|
-
root: 'apps/products',
|
|
12
|
-
sourceRoot: 'apps/products/src',
|
|
13
|
-
targets: {
|
|
14
|
-
start: {
|
|
15
|
-
executor: '@nrwl/react-native:start',
|
|
16
|
-
options: {
|
|
17
|
-
port: 8081,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
test: {
|
|
21
|
-
executor: '@nrwl/jest:jest',
|
|
22
|
-
options: {
|
|
23
|
-
jestConfig: 'apps/products/jest.config.ts',
|
|
24
|
-
passWithNoTests: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it(`should not remove transfrom if the code does not contain existing preprocessor`, async () => {
|
|
32
|
-
tree.write(
|
|
33
|
-
'apps/products/jest.config.ts',
|
|
34
|
-
`module.exports = {
|
|
35
|
-
preset: 'react-native',
|
|
36
|
-
};`
|
|
37
|
-
);
|
|
38
|
-
await update(tree);
|
|
39
|
-
|
|
40
|
-
const jestConfig = tree.read('apps/products/jest.config.ts', 'utf-8');
|
|
41
|
-
expect(jestConfig).not.toContain(`transform`);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it(`should remove transform if the code contains existing preprocessor`, async () => {
|
|
45
|
-
tree.write(
|
|
46
|
-
'apps/products/jest.config.ts',
|
|
47
|
-
`module.exports = {
|
|
48
|
-
preset: 'react-native',
|
|
49
|
-
testRunner: 'jest-jasmine2',
|
|
50
|
-
transform: {
|
|
51
|
-
'\\.(js|ts|tsx)$': require.resolve('react-native/jest/preprocessor.js'),
|
|
52
|
-
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
|
|
53
|
-
'react-native/jest/assetFileTransformer.js'
|
|
54
|
-
),
|
|
55
|
-
}
|
|
56
|
-
};`
|
|
57
|
-
);
|
|
58
|
-
await update(tree);
|
|
59
|
-
|
|
60
|
-
const jestConfig = tree.read('apps/products/jest.config.ts', 'utf-8');
|
|
61
|
-
expect(jestConfig).not.toContain('transfrom: {');
|
|
62
|
-
expect(jestConfig).not.toContain(`testRunner: 'jest-jasmine2',`);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it(`should rename .babelrc to babel.config.json`, async () => {
|
|
66
|
-
tree.write(
|
|
67
|
-
'apps/products/jest.config.ts',
|
|
68
|
-
`module.exports = {
|
|
69
|
-
preset: 'react-native',
|
|
70
|
-
};`
|
|
71
|
-
);
|
|
72
|
-
tree.write(
|
|
73
|
-
'apps/products/.babelrc',
|
|
74
|
-
`{
|
|
75
|
-
"presets": ["module:metro-react-native-babel-preset"]
|
|
76
|
-
}`
|
|
77
|
-
);
|
|
78
|
-
await update(tree);
|
|
79
|
-
|
|
80
|
-
expect(tree.exists('apps/products/.babelrc')).toBeFalsy();
|
|
81
|
-
expect(tree.exists('apps/products/babel.config.json')).toBeTruthy();
|
|
82
|
-
const babelConfigJson = tree.read(
|
|
83
|
-
'apps/products/babel.config.json',
|
|
84
|
-
'utf-8'
|
|
85
|
-
);
|
|
86
|
-
expect(babelConfigJson).toContain(
|
|
87
|
-
`"presets": ["module:metro-react-native-babel-preset"]`
|
|
88
|
-
);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it(`should not rename .babelrc to babel.config.json if app is not react native`, async () => {
|
|
92
|
-
tree.write(
|
|
93
|
-
'apps/products/jest.config.ts',
|
|
94
|
-
`module.exports = {
|
|
95
|
-
preset: 'other',
|
|
96
|
-
};`
|
|
97
|
-
);
|
|
98
|
-
tree.write(
|
|
99
|
-
'apps/products/.babelrc',
|
|
100
|
-
`{
|
|
101
|
-
"presets": ["module:metro-react-native-babel-preset"]
|
|
102
|
-
}`
|
|
103
|
-
);
|
|
104
|
-
await update(tree);
|
|
105
|
-
|
|
106
|
-
expect(tree.exists('apps/products/.babelrc')).toBeTruthy();
|
|
107
|
-
expect(tree.exists('apps/products/babel.config.json')).toBeFalsy();
|
|
108
|
-
});
|
|
109
|
-
});
|