Skip to content
Browse files

SimpleBoard reference; board first tests

  • Loading branch information...
1 parent 4f6f39b commit 7896c3dfe10eae5a0bcda96d355c419f1f826397 @ajlopez committed Jan 3, 2013
Showing with 33 additions and 0 deletions.
  1. +15 −0 lib/board.js
  2. +17 −0 lib/simplechess.js
  3. +1 −0 package.json
View
15 lib/board.js
@@ -0,0 +1,15 @@
+
+var simplechess = require('../'),
+ assert = require('assert');
+
+// create board
+
+var board = simplechess.createBoard();
+assert.ok(board);
+assert.equal(board.getWidth(), 8);
+assert.equal(board.getHeight(), 8);
+
+var positions = board.getPositions();
+
+assert.ok(positions);
+assert.equal(positions.length, 0);
View
17 lib/simplechess.js
@@ -0,0 +1,17 @@
+
+'use strict';
+
+if (typeof simpleboard === 'undefined')
+ var simpleboard = require('simpleboard');
+
+var simplego = (function () {
+ return {
+ createBoard: function () {
+ return simpleboard.createBoard(8, 8);
+ }
+ };
+})();
+
+if (typeof window === 'undefined') {
+ module.exports = simplego;
+}
View
1 package.json
@@ -10,6 +10,7 @@
"test": "node ./test.js"
}
, "dependencies": {
+ "simpleboard": "*"
}
, "devDependencies": {
}

0 comments on commit 7896c3d

Please sign in to comment.
Something went wrong with that request. Please try again.