Testing with Protractor can be quite challenging and confusing, especially for those new to it.
I currently have the following setup:
`SomeTestFile.spec.ts`
describe('A test: ', () => {
beforeEach(() => {
....
}
it ('Should validate a label', async() => {
await helper.validateALabel(label);
}
....
}
In the helper class:
helper.ts
export class Helper {
....
public validateLabel(label: String): Promise<void> {
expect(label).toBe('This is the string of the label');
}
....
}
My question is whether I need to await the expect(label).toBe(...)
?
Should I use
await expect(label).toBe(...)
OR is it okay as it is (and if so, why do I keep receiving Unhandled Promise Rejection Warnings)?
expect(label).toBe(...)