Use expect.arrayContaining

This commit is contained in:
Mitchell Borrego 2022-07-26 02:16:58 -04:00
parent 800a9b3e3d
commit 0db74381c5
No known key found for this signature in database
GPG key ID: BE864F77C8CFBB4C

View file

@ -140,13 +140,15 @@ describe('trim arguments after splitting them', () => {
const {execArgs} = buildExec(); const {execArgs} = buildExec();
expect(execArgs).toMatchObject([ expect(execArgs).toEqual(
expect.arrayContaining([
...baseExpectation, ...baseExpectation,
'-f', '-f',
'./client-coverage.txt', './client-coverage.txt',
'-f', '-f',
'./lcov.info', './lcov.info',
]); ]),
);
for (const env of Object.keys(envs)) { for (const env of Object.keys(envs)) {
delete process.env['INPUT_' + env.toUpperCase()]; delete process.env['INPUT_' + env.toUpperCase()];
@ -162,13 +164,15 @@ describe('trim arguments after splitting them', () => {
const {execArgs} = buildExec(); const {execArgs} = buildExec();
expect(execArgs).toMatchObject([ expect(execArgs).toEqual(
expect.arrayContaining([
...baseExpectation, ...baseExpectation,
'-F', '-F',
'ios', 'ios',
'-F', '-F',
'mobile', 'mobile',
]); ]),
);
for (const env of Object.keys(envs)) { for (const env of Object.keys(envs)) {
delete process.env['INPUT_' + env.toUpperCase()]; delete process.env['INPUT_' + env.toUpperCase()];
@ -184,13 +188,15 @@ describe('trim arguments after splitting them', () => {
const {execArgs} = buildExec(); const {execArgs} = buildExec();
expect(execArgs).toMatchObject([ expect(execArgs).toEqual(
expect.arrayContaining([
...baseExpectation, ...baseExpectation,
'-X', '-X',
'network', 'network',
'-X', '-X',
'gcov', 'gcov',
]); ]),
);
for (const env of Object.keys(envs)) { for (const env of Object.keys(envs)) {
delete process.env['INPUT_' + env.toUpperCase()]; delete process.env['INPUT_' + env.toUpperCase()];