Skip to content

Commit 66cdbde

Browse files
authored
feat(cli): print unsupported keypresses directly to console. (#1441)
* Print unsupported keypresses directly to console. * Increase unit test timeout and gradle cache * Reset chalk formatting in unit tests for WIndows based hosts * Enable yarn and gradle cache Source: https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
1 parent 0ccc149 commit 66cdbde

File tree

9 files changed

+38
-6
lines changed

9 files changed

+38
-6
lines changed

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ commands:
6464
steps:
6565
- attach_workspace:
6666
at: ~/react-native-cli
67+
- restore_cache:
68+
keys:
69+
- v2-gradle-dependencies-{{ checksum "package.json" }}
70+
- v2-gradle-dependencies-
6771
- run: yarn test:ci:e2e
72+
- save_cache:
73+
key: v2-gradle-dependencies-{{ checksum "package.json" }}
74+
paths:
75+
- ~/.gradle
6876

6977
jobs:
7078
setup:

azure-pipelines.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,38 @@ trigger:
44
pool:
55
vmImage: 'windows-2019'
66

7+
variables:
8+
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
9+
GRADLE_USER_HOME: $(Pipeline.Workspace)/.gradle
10+
711
steps:
812
- task: NodeTool@0
913
inputs:
1014
versionSpec: '12.x'
1115
displayName: 'Install Node.js'
1216

13-
- script: yarn install
17+
- task: Cache@2
18+
inputs:
19+
key: 'yarn | "$(Agent.OS)" | yarn.lock'
20+
restoreKeys: |
21+
yarn | "$(Agent.OS)"
22+
path: $(YARN_CACHE_FOLDER)
23+
displayName: Cache Yarn packages
24+
25+
- script: yarn --frozen-lockfile
1426
displayName: 'Install dependencies'
1527

1628
- script: yarn test:ci:unit
1729
displayName: 'Unit tests'
1830

31+
- task: Cache@2
32+
inputs:
33+
key: 'gradle | "$(Agent.OS)" | **/package.json'
34+
restoreKeys: |
35+
gradle | "$(Agent.OS)"
36+
gradle
37+
path: $(GRADLE_USER_HOME)
38+
displayName: Configure gradle caching
39+
1940
- script: yarn test:ci:e2e
2041
displayName: 'E2E tests'

packages/cli/src/commands/doctor/healthchecks/__tests__/androidNDK.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('androidNDK', () => {
1313

1414
beforeAll(async () => {
1515
environmentInfo = await getEnvironmentInfo();
16-
}, 15000);
16+
}, 60000);
1717

1818
afterEach(() => {
1919
jest.resetAllMocks();

packages/cli/src/commands/doctor/healthchecks/__tests__/androidSDK.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('androidSDK', () => {
5050

5151
beforeAll(async () => {
5252
environmentInfo = await getEnvironmentInfo();
53-
}, 15000);
53+
}, 60000);
5454

5555
afterEach(() => {
5656
jest.resetAllMocks();

packages/cli/src/commands/doctor/healthchecks/__tests__/androidStudio.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('androidStudio', () => {
1717
beforeAll(async () => {
1818
environmentInfo = await getEnvironmentInfo();
1919
((execa as unknown) as jest.Mock).mockResolvedValue({stdout: ''});
20-
}, 15000);
20+
}, 60000);
2121

2222
afterEach(() => {
2323
jest.resetAllMocks();

packages/cli/src/commands/doctor/healthchecks/__tests__/jdk.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('jdk', () => {
2727

2828
beforeAll(async () => {
2929
environmentInfo = await getEnvironmentInfo();
30-
}, 15000);
30+
}, 60000);
3131

3232
afterEach(() => {
3333
jest.resetAllMocks();

packages/cli/src/commands/start/watchMode.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ function enableWatchMode(messageSocket: any) {
4848
} else if (name === 'd') {
4949
messageSocket.broadcast('devMenu', null);
5050
logger.info('Opening developer menu...');
51+
} else {
52+
console.log(_key);
5153
}
5254
});
5355
}

packages/cli/src/tools/config/__tests__/__snapshots__/index-test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Object {
153153

154154
exports[`should skip packages that have invalid configuration: dependencies config 1`] = `Object {}`;
155155

156-
exports[`should skip packages that have invalid configuration: logged warning 1`] = `"Package [1mreact-native[22m has been ignored because it contains invalid configuration. Reason: [2m\\"dependency.invalidProperty\\" is not allowed[22m"`;
156+
exports[`should skip packages that have invalid configuration: logged warning 1`] = `"Package react-native has been ignored because it contains invalid configuration. Reason: \\"dependency.invalidProperty\\" is not allowed"`;
157157

158158
exports[`supports dependencies from user configuration with custom build type 1`] = `
159159
Object {

packages/cli/src/tools/config/__tests__/index-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ test('should load commands from "react-native-foo" and "react-native-bar" packag
187187
});
188188

189189
test('should skip packages that have invalid configuration', () => {
190+
process.env.FORCE_COLOR = '0'; // To disable chalk
190191
DIR = getTempDirectory('config_test_skip');
191192
writeFiles(DIR, {
192193
'node_modules/react-native/package.json': '{}',

0 commit comments

Comments
 (0)