Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should add video attachment placeholder to Allure, if using Allure', () => {
let video = new Video(options);
video.onTestEnd({ title: 'TEST', state: 'failed' });
expect(allureMocks.addAttachment).not.toHaveBeenCalled();
allureMocks.addAttachment = jest.fn();
options.saveAllVideos = true;
video = new Video(options);
video.onTestEnd({ title: 'TEST', state: 'passed' });
expect(allureMocks.addAttachment).not.toHaveBeenCalled();
allureMocks.addAttachment = jest.fn();
video = new Video(options);
video.config.usingAllure = true;
video.onTestEnd({ title: 'TEST', state: 'failed' });
expect(allureMocks.addAttachment).toHaveBeenCalled();
allureMocks.addAttachment = jest.fn();
video = new Video(options);
video.config.usingAllure = true;
video.onTestEnd({ title: 'TEST', state: 'failed' });
expect(allureMocks.addAttachment).toHaveBeenCalled();
});
beforeEach(() => {
allureMocks.addAttachment = jest.fn();
allureMocks.addArgument = jest.fn();
helpers.default.generateVideo = jest.fn();
options.saveAllVideos = false;
configModule.default.saveAllVideos = false;
configModule.default.usingAllure = false;
});