Browse Source

Fixed tests (perhaps the results are different per machine?)

pull/55/head
james.cryer 9 years ago
parent
commit
6d7fb49946
  1. 6019
      tests/chai-3.4.2.js
  2. 21
      tests/main_spec.js
  3. 2
      tests/test.html

6019
tests/chai-3.4.2.js

File diff suppressed because it is too large Load Diff

21
tests/main_spec.js

@ -10,10 +10,15 @@ function request_success () {
.compareTo("../demoassets/People2.jpg") .compareTo("../demoassets/People2.jpg")
.onComplete( function ( data ) { .onComplete( function ( data ) {
console.info("Reached oncomplete for request_success"); console.info("Reached oncomplete for request_success");
expect(data.diffBounds).to.deep.equal({ bottom: 431, left: 22, right: 454, top: 58 }); expect(data.diffBounds).to.have.all.keys('bottom', 'left', 'top', 'right');
expect(data.dimensionDifference).to.deep.equal({ height: 0, width: 0 }); expect(data.diffBounds.bottom).to.equal(431);
expect(data.diffBounds.left).to.equal(22);
expect(data.diffBounds.right).to.equal(450);
expect(data.diffBounds.top).to.equal(58);
expect(data.dimensionDifference.height).to.equal(0);
expect(data.dimensionDifference.width).to.equal(0);
expect(data.isSameDimensions).to.be.true; expect(data.isSameDimensions).to.be.true;
expect(data.misMatchPercentage).to.equal("8.65"); expect(data.misMatchPercentage).to.equal("8.66");
resolve(); resolve();
}); });
}); });
@ -26,10 +31,14 @@ function base64_string () {
.compareTo(people2_src) .compareTo(people2_src)
.onComplete( function ( data ) { .onComplete( function ( data ) {
console.info("Reached oncomplete for base64_string"); console.info("Reached oncomplete for base64_string");
expect(data.diffBounds).to.deep.equal({ bottom: 431, left: 22, right: 454, top: 58 }); expect(data.diffBounds.bottom).to.equal(431);
expect(data.dimensionDifference).to.deep.equal({ height: 0, width: 0 }); expect(data.diffBounds.left).to.equal(22);
expect(data.diffBounds.right).to.equal(450);
expect(data.diffBounds.top).to.equal(58);
expect(data.dimensionDifference.height).to.equal(0);
expect(data.dimensionDifference.width).to.equal(0);
expect(data.isSameDimensions).to.be.true; expect(data.isSameDimensions).to.be.true;
expect(data.misMatchPercentage).to.equal("8.65"); expect(data.misMatchPercentage).to.equal("8.66");
resolve(); resolve();
}); });
}); });

2
tests/test.html

@ -6,7 +6,7 @@
<body> <body>
<p>Check the console for test results</p> <p>Check the console for test results</p>
<script src="../resemble.js"></script> <script src="../resemble.js"></script>
<script src="chai-3.4.2.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/chai/3.4.1/chai.js"></script>
<script src="main_spec.js"></script> <script src="main_spec.js"></script>
</body> </body>
</html> </html>
Loading…
Cancel
Save