https://github.com/dereke/hypermonkey
https://github.com/dereke/hypermonkey
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dereke/hypermonkey
- Owner: dereke
- Created: 2016-11-06T23:11:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-29T10:04:36.000Z (over 8 years ago)
- Last Synced: 2025-02-20T09:19:25.620Z (4 months ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Hyper Monkey
Test your hyperdom apps using browser-monkey and vinehill with just a few lines of code# Get started
```javascript
/** @jsx hyperdom.jsx */// --------- your express app ---------
var expressApp = (require('express'))();
expressApp.get('/api/frameworks', (req, res) => {
res.json([
'browser-monkey',
'hyperdom',
'vinehill',
]);
});// --------- your hyperdom app ---------
var httpism = require('httpism/browser');
var hyperdom = require('hyperdom');
var html = hyperdom.html;class WebApp {
constructor() {
var self = this;
this.model = {
frameworks: []
};httpism.get('/api/frameworks').then(response => {
self.model.frameworks = response.body;
self.model.refresh();
});
}render() {
this.model.refresh = html.refresh;return
- {name} )}
{this.model.frameworks.map(name =>
}
}
// --------- your tests ---------
var hypermonkey = require('hypermonkey');
describe('my awesome app', () => {
var monkey;
beforeEach(() => {
monkey = hypermonkey()
.withServer('http://localhost:1234', expressApp)
.withApp(() => new WebApp())
.start();
});
afterEach(() => monkey.stop());
it('loads some data', () => {
return monkey.browser.find('li').shouldHave({text: [
'browser-monkey',
'hyperdom',
'vinehill',
]})
});
});
```