Skip to content

Commit 44936a7

Browse files
committed
chore: format with prettify
1 parent 57fc0f6 commit 44936a7

File tree

1 file changed

+32
-26
lines changed

1 file changed

+32
-26
lines changed

test.js

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@ const initialWorkingDir = process.cwd();
2222

2323
const mkCommand =
2424
(cmd) =>
25-
(args, options = {}) => {
26-
options['env'] = Object.assign(
27-
{ SLS_DEBUG: 'true' },
28-
process.env,
29-
options['env']
30-
);
31-
const { error, stdout, stderr, status } = crossSpawn.sync(
32-
cmd,
33-
args,
34-
options
25+
(args, options = {}) => {
26+
options['env'] = Object.assign(
27+
{ SLS_DEBUG: 'true' },
28+
process.env,
29+
options['env']
30+
);
31+
const { error, stdout, stderr, status } = crossSpawn.sync(
32+
cmd,
33+
args,
34+
options
35+
);
36+
if (error && !options['noThrow']) {
37+
console.error(`Error running: ${quote([cmd, ...args])}`); // eslint-disable-line no-console
38+
throw error;
39+
}
40+
if (status && !options['noThrow']) {
41+
console.error('STDOUT: ', stdout.toString()); // eslint-disable-line no-console
42+
console.error('STDERR: ', stderr.toString()); // eslint-disable-line no-console
43+
throw new Error(
44+
`${quote([cmd, ...args])} failed with status code ${status}`
3545
);
36-
if (error && !options['noThrow']) {
37-
console.error(`Error running: ${quote([cmd, ...args])}`); // eslint-disable-line no-console
38-
throw error;
39-
}
40-
if (status && !options['noThrow']) {
41-
console.error('STDOUT: ', stdout.toString()); // eslint-disable-line no-console
42-
console.error('STDERR: ', stderr.toString()); // eslint-disable-line no-console
43-
throw new Error(
44-
`${quote([cmd, ...args])} failed with status code ${status}`
45-
);
46-
}
47-
return stdout && stdout.toString().trim();
48-
};
46+
}
47+
return stdout && stdout.toString().trim();
48+
};
4949

5050
const sls = mkCommand('sls');
5151
const git = mkCommand('git');
@@ -421,7 +421,7 @@ test(
421421
);
422422
t.true(
423423
zipfiles.filter((filename) => filename.endsWith('__main__.py')).length >
424-
0,
424+
0,
425425
'__main__.py files are packaged'
426426
);
427427
t.end();
@@ -1722,7 +1722,13 @@ test('py3.7 injects dependencies into `package` folder when using scaleway provi
17221722
npm(['i', path]);
17231723
sls(['package'], { env: {} });
17241724
const zipfiles = await listZipFiles('.serverless/sls-py-req-test.zip');
1725-
t.true(zipfiles.includes(`package${sep}flask${sep}__init__.py`), 'flask is packaged');
1726-
t.true(zipfiles.includes(`package${sep}boto3${sep}__init__.py`), 'boto3 is packaged');
1725+
t.true(
1726+
zipfiles.includes(`package${sep}flask${sep}__init__.py`),
1727+
'flask is packaged'
1728+
);
1729+
t.true(
1730+
zipfiles.includes(`package${sep}boto3${sep}__init__.py`),
1731+
'boto3 is packaged'
1732+
);
17271733
t.end();
17281734
});

0 commit comments

Comments
 (0)