Skip to content

Commit

Permalink
Merge pull request #73 from featurist/hyperx
Browse files Browse the repository at this point in the history
require('hyperdom/hyperx')
  • Loading branch information
refractalize authored Apr 9, 2017
2 parents 43e308d + 1143165 commit 6813edf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hyperx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
try {
var hyperx = require('hyperx')
} catch(e) {
if (e.code == 'MODULE_NOT_FOUND') {
throw new Error('to use hyperx with hyperdom you need to install the hyperx package')
}
throw e
}

module.exports = hyperx(require('./rendering').jsx)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"chai": "3.5.0",
"detect-browser": "1.6.2",
"electron": "1.6.2",
"hyperx": "2.3.0",
"jquery": "2.1.3",
"jquery-sendkeys": "4.0.0",
"jsdom": "8.2.0",
Expand Down
9 changes: 9 additions & 0 deletions test/server/hyperxSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var hx = require('../../hyperx')
var toHtml = require('../../toHtml')
var expect = require('chai').expect

describe('hyperx', function () {
it('can render with hyperx', function () {
expect(toHtml(hx`<div>hi</div>`)).to.equal('<div>hi</div>')
})
})

0 comments on commit 6813edf

Please sign in to comment.