How to use the gemini-core.Image.prototype function in gemini-core

To help you get started, we’ve selected a few gemini-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gemini-testing / gemini / test / unit / state-processor / capture-processor / utils.js View on Github external
it('"false" if the image was not saved', () => {
                Image.prototype.save.rejects();

                return save_({refPath: '/ref/path'})
                    .then((res) => assert.isFalse(res));
            });
        });
github gemini-testing / hermione / test / lib / browser / commands / assert-view / index.js View on Github external
beforeEach(() => {
        sandbox.stub(Image, 'create').returns(Object.create(Image.prototype));
        sandbox.stub(Image, 'compare').resolves(true);
        sandbox.stub(Image.prototype, 'getSize');

        sandbox.stub(fs, 'readFileSync');
        sandbox.stub(fs, 'existsSync').returns(true);

        sandbox.stub(temp, 'path');
        sandbox.stub(temp, 'attach');

        sandbox.stub(RuntimeConfig, 'getInstance').returns({tempOpts: {}});

        sandbox.spy(ScreenShooter, 'create');
        sandbox.stub(ScreenShooter.prototype, 'capture').resolves(stubImage_());

        sandbox.stub(updateRefs, 'handleNoRefImage').resolves();
        sandbox.stub(updateRefs, 'handleImageDiff').resolves();
    });
github gemini-testing / gemini / test / unit / state-processor / capture-processor / utils.js View on Github external
beforeEach(() => {
            sandbox.stub(fs, 'mkdirsAsync').returns(Promise.resolve());
            sandbox.stub(Image.prototype, 'save').returns(Promise.resolve());
        });
github gemini-testing / hermione / test / lib / browser / commands / assert-view / index.js View on Github external
beforeEach(() => {
        sandbox.stub(Image, 'create').returns(Object.create(Image.prototype));
        sandbox.stub(Image, 'compare').resolves(true);
        sandbox.stub(Image.prototype, 'getSize');

        sandbox.stub(fs, 'readFileSync');
        sandbox.stub(fs, 'existsSync').returns(true);

        sandbox.stub(temp, 'path');
        sandbox.stub(temp, 'attach');

        sandbox.stub(RuntimeConfig, 'getInstance').returns({tempOpts: {}});

        sandbox.spy(ScreenShooter, 'create');
        sandbox.stub(ScreenShooter.prototype, 'capture').resolves(stubImage_());

        sandbox.stub(updateRefs, 'handleNoRefImage').resolves();
        sandbox.stub(updateRefs, 'handleImageDiff').resolves();
github gemini-testing / gemini / test / unit / state-processor / capture-processor / capture-processor.js View on Github external
beforeEach(() => {
        sandbox.stub(fs, 'readFileSync');
        sandbox.stub(temp, 'path');
        sandbox.stub(utils, 'copyImg').resolves(true);
        sandbox.stub(utils, 'saveRef').resolves(true);
        sandbox.stub(utils, 'existsRef').resolves(true);
        sandbox.stub(Image, 'create').returns(Object.create(Image.prototype));
        sandbox.stub(Image, 'compare').resolves(true);
        sandbox.stub(Image.prototype, 'save').resolves();
        sandbox.stub(Image.prototype, 'getSize');
    });
github gemini-testing / gemini / test / unit / state-processor / capture-processor / capture-processor.js View on Github external
const mkImage = (opts = {}) => {
        opts = _.defaults(opts, {size: {width: 100500, height: 500100}});

        return {
            compare: Image.compare,
            save: Image.prototype.save,
            getSize: sandbox.stub().returns(opts.size)
        };
    };
github gemini-testing / gemini / test / unit / state-processor / capture-processor / capture-processor.js View on Github external
beforeEach(() => {
        sandbox.stub(fs, 'readFileSync');
        sandbox.stub(temp, 'path');
        sandbox.stub(utils, 'copyImg').resolves(true);
        sandbox.stub(utils, 'saveRef').resolves(true);
        sandbox.stub(utils, 'existsRef').resolves(true);
        sandbox.stub(Image, 'create').returns(Object.create(Image.prototype));
        sandbox.stub(Image, 'compare').resolves(true);
        sandbox.stub(Image.prototype, 'save').resolves();
        sandbox.stub(Image.prototype, 'getSize');
    });