Skip to content

Commit 613812b

Browse files
committed
add specs
1 parent 91f80b6 commit 613812b

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

test/unit/bin/helpers/utils.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,6 +2313,54 @@ describe('utils', () => {
23132313
);
23142314
glob.sync.restore();
23152315
});
2316+
2317+
it('glob search pattern should contain default cypress 10 folder when cypressTestSuiteType is CYPRESS_V10_AND_ABOVE_TYPE', () => {
2318+
let getNumberOfSpecFilesStub = sinon.stub(glob, 'sync');
2319+
let bsConfig = {
2320+
run_settings: {
2321+
cypressProjectDir: 'cypressProjectDir',
2322+
exclude: 'exclude',
2323+
cypressTestSuiteType: constant.CYPRESS_V10_AND_ABOVE_TYPE
2324+
},
2325+
};
2326+
2327+
utils.getNumberOfSpecFiles(bsConfig, {}, {});
2328+
2329+
sinon.assert.calledOnceWithExactly(
2330+
getNumberOfSpecFilesStub,
2331+
`cypress/e2e/**/*.+(${constant.specFileTypes.join('|')})`,
2332+
{
2333+
cwd: 'cypressProjectDir',
2334+
matchBase: true,
2335+
ignore: 'exclude',
2336+
}
2337+
);
2338+
glob.sync.restore();
2339+
});
2340+
2341+
it('glob search pattern should contain default cypress folder when cypressTestSuiteType is not CYPRESS_V10_AND_ABOVE_TYPE', () => {
2342+
let getNumberOfSpecFilesStub = sinon.stub(glob, 'sync');
2343+
let bsConfig = {
2344+
run_settings: {
2345+
cypressProjectDir: 'cypressProjectDir',
2346+
exclude: 'exclude',
2347+
cypressTestSuiteType: constant.CYPRESS_V9_AND_OLDER_TYPE
2348+
},
2349+
};
2350+
2351+
utils.getNumberOfSpecFiles(bsConfig, {}, {});
2352+
2353+
sinon.assert.calledOnceWithExactly(
2354+
getNumberOfSpecFilesStub,
2355+
`cypress/integration/**/*.+(${constant.specFileTypes.join('|')})`,
2356+
{
2357+
cwd: 'cypressProjectDir',
2358+
matchBase: true,
2359+
ignore: 'exclude',
2360+
}
2361+
);
2362+
glob.sync.restore();
2363+
});
23162364
});
23172365

23182366
describe('warnSpecLimit', () => {

0 commit comments

Comments
 (0)