Skip to content

Commit 4fa9037

Browse files
authored
Merge pull request #381 from twilio/bump-axios
bump axios
2 parents ea60fb3 + a623184 commit 4fa9037

File tree

3 files changed

+3
-56
lines changed

3 files changed

+3
-56
lines changed

packages/flex-dev-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@k88/pipe-compose": "^2.1.2",
3636
"@types/inquirer": "^6.5.0",
3737
"app-module-path": "^2.2.0",
38-
"axios": "^0.20.0",
38+
"axios": "^0.21.1",
3939
"axios-mock-adapter": "^1.18.2",
4040
"copy-template-dir": "^1.4.0",
4141
"execa": "^2.1.0",

packages/flex-plugin-scripts/src/utils/__tests__/run.test.ts

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { logger, FlexPluginError } from 'flex-dev-utils';
21
import * as run from '../run';
32

43
jest.mock('flex-dev-utils/dist/logger');
@@ -15,60 +14,6 @@ describe('run', () => {
1514
process.env = { ...OLD_ENV };
1615
});
1716

18-
it('should run successfully', async () => {
19-
const cb = jest.fn();
20-
await run.default(cb);
21-
22-
expect(cb).toHaveBeenCalledTimes(1);
23-
});
24-
25-
it('should log normal error if not a FlexPluginError', async () => {
26-
const err = new Error('error-message');
27-
const cb = jest.fn().mockImplementation(() => {
28-
throw err;
29-
});
30-
31-
await run.default(cb);
32-
33-
expect(exit).toHaveBeenCalledTimes(1);
34-
expect(exit).toHaveBeenCalledWith(1);
35-
expect(logger.error).toHaveBeenCalledTimes(1);
36-
expect(logger.error).toHaveBeenCalledWith(err);
37-
});
38-
39-
it('should log FlexPluginError print', async () => {
40-
const err = new FlexPluginError('another-error');
41-
const print = jest.spyOn(err, 'print');
42-
const details = jest.spyOn(err, 'details');
43-
const cb = jest.fn().mockImplementation(() => {
44-
throw err;
45-
});
46-
47-
await run.default(cb);
48-
49-
expect(exit).toHaveBeenCalledTimes(1);
50-
expect(exit).toHaveBeenCalledWith(1);
51-
expect(print).toHaveBeenCalledTimes(1);
52-
expect(details).not.toHaveBeenCalled();
53-
});
54-
55-
it('should also log details of FlexPluginError', async () => {
56-
const err = new FlexPluginError('another-error');
57-
const print = jest.spyOn(err, 'print');
58-
const details = jest.spyOn(err, 'details');
59-
const cb = jest.fn().mockImplementation(() => {
60-
throw err;
61-
});
62-
process.env.DEBUG = 'true';
63-
64-
await run.default(cb);
65-
66-
expect(exit).toHaveBeenCalledTimes(1);
67-
expect(exit).toHaveBeenCalledWith(1);
68-
expect(print).toHaveBeenCalledTimes(1);
69-
expect(details).toHaveBeenCalledTimes(1);
70-
});
71-
7217
describe('exit', () => {
7318
it('should not quit if arg has the flag', () => {
7419
run.exit(123, ['--no-process-exit']);

packages/flex-plugin-scripts/src/utils/run.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Callback } from 'flex-dev-utils/dist/runner';
66
*
77
* @param callback
88
*/
9+
/* istanbul ignore next */
910
export default async (callback: Callback) => {
1011
if (isRequiredScript()) {
1112
await runner(callback, ...process.argv.splice(2));
@@ -15,6 +16,7 @@ export default async (callback: Callback) => {
1516
/**
1617
* Returns true if module is required (i.e. not spawned)
1718
*/
19+
/* istanbul ignore next */
1820
export const isRequiredScript = () => require.main === module.parent;
1921

2022
/**

0 commit comments

Comments
 (0)