# XWindow [![Build Status](https://travis-ci.org/cswleocsw/XWindow.svg?branch=master)](https://travis-ci.org/cswleocsw/XWindow)
 * XWindow is a wrapper for the browser object model(BOM) and provide similar interface.
 * XWindow is a proxy object for window.
 * Easy for stub. ([sinon](http://sinonjs.org/))


### TODO
 - [X] location
 - [X] screen
 - [X] history
 - [X] navigator
 - [X] document
    - [X] cookie
 - ...

### HOW-TO-USE
```js
var XWindow = require('XWindow')

// proxy widnow object actions
// get
XWindow.location.hash() === window.location.hash

// set
XWindow.location.hash('ABC') === (window.location.hash = 'ABC') 

// unit test
var stub = sinon.stub(XWindow.location, 'hash').returns('#ABC')

// exmaple on button click
var btn = document.getElementById('test')

btn.onclick = function() {
    XWindow.location.hash('ABC') 
}

expect(stub.called).to.be.true
stub.restore()

```
