spec/DiceSetSpec.js

  1. /** Some tests for the DiceSet class.
  2. *
  3. * @test {DiceSet}*/
  4. describe("DiceSet", function () {
  5. let CPM = require("../build/artistoo-cjs.js")
  6. let cpm
  7.  
  8. beforeEach( function() {
  9. // Build a cpm and a ca
  10. cpm = new CPM.CPM( [100,1], [true,false],
  11. { T:20,
  12. J : [[0,20],[20,0]]
  13. } )
  14. })
  15.  
  16. it( " should start empty", function(){
  17.  
  18. expect( cpm.borderpixels.elements.length ).toEqual( 0 )
  19.  
  20. })
  21.  
  22. it( " should be empty after an element is added and removed", function(){
  23.  
  24. cpm.borderpixels.insert( 1 )
  25. cpm.borderpixels.remove( 1 )
  26. expect( cpm.borderpixels.elements.length ).toEqual( 0 )
  27.  
  28. })
  29.  
  30. })
  31.