unroll('should be okay with value being null or undefined when id is #id', (done, testArgs) => {
let object = { id: testArgs.id };
expect(object.id).toEqual(testArgs.id);
done();
},
`
where:
id
someRandomText
${null}
${undefined}
`
);
// Output:
✖ encountered a declaration exception
Error: title not expanded as incorrect args passed in
Expected behavior:
✔ should be okay with value being null or undefined when id is null
✔ should be okay with value being null or undefined when id is undefined
Granted, I understand with the dataTable method this is a bit tricky since it is a template literal (i.e., what if someone wants to test the string "null" or "undefined"), but I think the dataArray method should work as long as we are okay with stringifying those two values (in the general sense, not JSON.stringify as undefined is not a valid value).
Current behavior:
Expected behavior:
Granted, I understand with the dataTable method this is a bit tricky since it is a template literal (i.e., what if someone wants to test the string "null" or "undefined"), but I think the dataArray method should work as long as we are okay with stringifying those two values (in the general sense, not
JSON.stringify
as undefined is not a valid value).