qase-tms / qase-javascript

Qase TMS JavaScript SDK
https://developers.qase.io
49 stars 43 forks source link

[qase-cypress] No check for null in qase method #116

Closed DanilTaGiL closed 2 years ago

DanilTaGiL commented 2 years ago

At this moment:
https://github.com/qase-tms/qase-javascript/blob/7a279b5e3bcffeafe4cd9a0de84161dffa1f5752/qase-cypress/src/mocha.ts#L3-L5 Should be smth like this:

    qase: <T>(caseId: number | string | number[] | string[], test: T): T => {
        if (!test) {
            return test;
        }
        const testNew = test as unknown as Record<string,string>;
        let caseIds: number[] | string[];

I try this fix locally, it solve the problem.

I found this problem when use cypress-grep together with qase-cypress. There's a feature that we could omit tests after grep. But this is return null tests. And as there no check for null, in this case test run will broke up.

DanilTaGiL commented 2 years ago

fixed