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