File: test/lib/screenshots.js

Recommend this page to a friend!
  Classes of Igor Escobar   Automated Screenshot Diff   test/lib/screenshots.js   Download  
File: test/lib/screenshots.js
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Automated Screenshot Diff
Capture and compare page screenshots
Author: By
Last change: Update of test/lib/screenshots.js
Date: 3 years ago
Size: 1,103 bytes
 

Contents

Class file image Download
var assert = require('assert'), nock = require('nock'), sinon = require('sinon'), Screenshots = require('../../lib/screenshots.js'); describe('#compare()', function(){ before(function(){ Screenshots.test = true; }); beforeEach(function(){ this.screenshots = new Screenshots(); }); it('should exists', function(){ assert.equal(typeof this.screenshots.compare, "function"); }); it('should return invalid currentRelease', function(){ var data = this.screenshots.compare({}); assert.equal(data, "invalid parameter [currentRelease]"); }); it('should return invalid previousRelease', function(){ var data = this.screenshots.compare({currentRelease: 'v1'}); assert.equal(data, "invalid parameter [previousRelease]"); }); it('should return invalid source', function(){ var data = this.screenshots.compare({currentRelease: 'v1', previousRelease: 'v2'}); assert.equal(data, "invalid parameter [source]"); }); it('should execute diff', function(){ var data = this.screenshots.compare({currentRelease: 'v2', previousRelease: 'v1', source: 'test/images/'}); }); })